Skip to content

Instantly share code, notes, and snippets.

#include "syscalls.h"
#define internal static
#define stdout 1
typedef unsigned long int uintptr; /* size_t */
typedef long int intptr; /* ssize_t */
#ifdef __x86_64__
asm (
"_start:\n"
" xorl %ebp,%ebp\n"
" movq 0(%rsp),%rdi\n" /* argc loaded */
#include <stdio.h>
int main(void);
int main(void){
int m, n;
int r = 1;
scanf("%d", &m);
scanf("%d", &n);
if (m < n) {
@mb6ockatf
mb6ockatf / COPYING
Created July 3, 2025 18:50
ccasino game in lua
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
global sys_read
global sys_write
global sys_errno
section .text
generic_syscall_3:
push ebp
mov ebp, esp
push ebx
mov ebx, [ebp + 8]
@mb6ockatf
mb6ockatf / emoji_replacable.txt
Last active July 26, 2024 20:24
do not remove this file. seriously -- it is used (curl'ed) somewhere, and by the time you read this u don't remeber where. just leave it as-is
school
books
book
notebook
calendar
snake
angry
pill
running
child
@mb6ockatf
mb6ockatf / grayscale.py
Last active April 13, 2024 12:53
convert image to grayscale
#!/usr/bin/env python3
from PIL import Image
img = Image.open('image.jpg').convert('L')
img.save('greyscale.jpg')
@mb6ockatf
mb6ockatf / .gitattributes
Last active November 9, 2024 17:44
github linguist no more ignores certain languages
*.md linguist-documentation=false
*.md linguist-detectable
*.adoc linguist-documentation=false
*.adoc linguist-detectable
*.rst linguist-documentation=false
*.rst linguist-detectable
*.sql linguist-documentation=false
*.sql linguist-detectable
*.creole linguist-documentation=false
*.creole linguist-detectable
@mb6ockatf
mb6ockatf / iss.sh
Created March 21, 2024 15:52
iss coords writer in bash
while [ 1 ]
do
p=$(date +%Y)/$(date +%m)/$(date +%d)/$(date +%H)
mkdir -p $p
out=$p/$(date +%s).txt
curl "http://api.open-notify.org/iss-now.json" > $out
git add -A
git commit -m "changed $(date +%s)"
git push
date
for file in *.jpg.jpg; do
mv -- "$file" "${file%.jpg.jpg}.jpg"
done
@mb6ockatf
mb6ockatf / pool.c
Last active February 11, 2024 14:10
strstr does not work properly
#include <stdio.h>
#include <string.h>
char tracks[][80] = {
"I left my heart in Harvard Med School",
"Newark, Newark - a wonderful town",
"Dancing with a Dork",
"From here to maternity",
"The girl from Iwo Jima",
};