Skip to content

Instantly share code, notes, and snippets.

[ yoruemom.b
prints epic ascii art of yor'ue mom, in brainfuck.
Uses 4 memory cells, safe regardless of EOF or cell size.
By unsubtract, January 2nd 2021: https://github.com/unsubtract/ ]
++++ ++++ ++ Newline (10) on Cell 0
>>++++[<++++ ++++ >-] Space (32) on Cell 1
>++++ ++[<++++ ++++ >-] Zero (48) on Cell 2
<<
Line
1 .... .... .... >... <.... .... . >.. <<.
@user21944
user21944 / hello.c
Last active September 19, 2023 12:18
simple hello world
#include <stdio.h>
int main(void) {
for(char c[]={0,0110,055,0101,055,0102,0156,0116,031,0166,04,0150,014,055,047
};*c<(((c[1]-c[2])>>1)^3);)putchar(c[(int)c[0]]^c[(long)++*c]);
}
@user21944
user21944 / winapi_folders_test.c
Last active September 21, 2023 16:54
winapi folders test
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>
static int enter_directory(void) {
WIN32_FIND_DATA FindFileData;
HANDLE hFind = FindFirstFileA("./*", &FindFileData);
if (hFind == INVALID_HANDLE_VALUE) {
fputs("could not open directory\n", stderr);
return 1;
@user21944
user21944 / crt.S
Last active January 16, 2024 02:52
small and efficient c startup code (crt0) and standard library, lightweight replacement for libc suitible for arch linux users around the world
.text
.global _start, syscall3
_start:
xorl %ebp, %ebp
/* popq %rdi
* movq %rsp, %rsi */
/* call main */
jmp main
#!bin\batch.executable : @execute
```lisp
This program is free software: you can redistribute it and/or modify it under the terms of the BAL General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the BAL General Public License for more details.
You should have received a copy of the BAL General Public License along with this program. If not, see <https://www.bal.org/licenses/>.
```
declare syscall 1
@stream = 1 <!-- stderr -->
@user21944
user21944 / server
Last active June 10, 2023 21:46
highly advanced bash tcp server
#!/bin/sh
while true; do /usr/bin/neofetch | nc -lw 0 31337 > /dev/null; done
@user21944
user21944 / brainfuck.nut
Created January 24, 2023 01:10
brainfuck vscript
const src = @"
>++++++++[-<+++++++++>]<.>>+>-[+]++>++>+++[>[->+++<<+++>]<<]>-----.>->
+++..+++.>-.<<+[>[+>+]>>]<--------------.>>.+++.------.--------.>+.>+.
";
const MEMSIZE = 0x7FFF; // using n^2-1 to enable wrapping without modulo
const CELLSIZE = 0xFF; // 0xFF 8-bit, 0xFFFF 16-bit, 0xFFFFFFFF 32-bit
const INSTRCOUNT = 2048;
local mem = array(MEMSIZE + 1, 0); // add one to account for zero index
>>++++++++[<++++++++>-]<++
>>++++++++++[<+++++++++++>-]<++++
>>++++++++++[<++++++++++++>-]<---
>>+++++++++[<+++++++++++>-]<+++++
>>+++++[<++++++>-]<+++
<<<<<,[>.>.>.>.>.<<<<<,]
@user21944
user21944 / Bruh!.b
Created December 22, 2022 13:54
Bruh!
>>++++++++[<++++++++>-]<++>>++++++++++[<+++++++++++>-]<++++>>++++++++++[<++++++++++++>-]<--->>+++++++++[<+++++++++++>-]<+++++>>+++++[<++++++>-]<+++<<<<<,[>.>.>.>.>.<<<<<,]
@user21944
user21944 / rock-paper-scissors.py
Last active April 26, 2023 15:33
Better than elincyt
#!/usr/bin/env python
import random
C = ["rock", "paper", "scissors"]
c = random.randint(0,2)
while True:
x = input("1: rock, 2: paper, 3: scissors\n")
if x.isdigit():
x = int(x) - 1
if (x >= 0 and x <= 2): break
print("Please select a valid option:")