Skip to content

Instantly share code, notes, and snippets.

View kspalaiologos's full-sized avatar
❤️‍🔥

Kamila Szewczyk kspalaiologos

❤️‍🔥
View GitHub Profile
@kspalaiologos
kspalaiologos / bf.c
Created November 15, 2017 17:14 — forked from maxcountryman/bf.c
A simple brainfuck interpreter in C
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
// initialize the tape with 30,000 zeroes
unsigned char tape[30000] = {0};
// set the pointer to point at the left-most cell of the tape
unsigned char* ptr = tape;
@kspalaiologos
kspalaiologos / autobuild.sh
Created October 1, 2018 17:04
Stupid script to build my things automatically.
#!/bin/sh
RED='\033[0;31m'
GREEN='\033[0;33m'
CLR='\033[2K'
NC='\033[0m'
function run {
c_time=$(sed -n 's/.*compile_delay *= *\([^ ]*.*\)/\1/p' < AUTOBUILD)
@kspalaiologos
kspalaiologos / TEST.C
Created October 8, 2018 13:32
Tiny C89 program that will blow mind of most highlighters.
/\
* \ Small valid C89 program. Fun fact is, it doesnt compile as cpp
* / NO extensions. Most highlighters and parsers are bailing out on this.
\/
// ***/ func() { printf("Hello /* world */ %d ???/?=\n" ??/
, 1?
'\\
007':
'??/"'/*"*/
@kspalaiologos
kspalaiologos / 189358
Created August 11, 2019 16:47
Challenge #189358 solved in Malbolge
This file has been truncated, but you can view the full file.
>>>+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]<<<+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]>>>>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]>>>>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]+>[<->[->>+<<]]>>[-<<+>>]<<<[->>-<<]>-<>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]<<<+>[<->[->>+<<]]>>[-<<+>>]<<<[->>-<<]>-<>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<]>>>>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]<<<+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<[[-]+>[<->[->>+<<]]>>[-<<+>>]<<<[->>-<<]>-<>[<+>[->>+<<]]>>[-<<+>>]<[<<+>>[->+<]]>[-<+>]<<<]<<<<<<<<<<<<<<<<<<<<<<<<<<<+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+<<]]>>[-<<+>>]<<<[->>+<<]+>+[<->[->>+
@kspalaiologos
kspalaiologos / bits.c
Created February 20, 2020 17:44
Count set bits in O(1)
#include <inttypes.h>
uint16_t bits(int64_t a) {
uint64_t x;
a -= (a >> 1) & 0x5555555555555555;
x = ((a >> 2) & 0x3333333333333333) + (a & 0x3333333333333333);
return (((int64_t) ((x + (x >> 4)) & 0xf0f0f0f0f0f0f0f)) * ((int64_t) 0x101010101010101)) >> 56;
}
@kspalaiologos
kspalaiologos / syscalls.c
Created March 17, 2020 19:36
A terrible abomination that disguises as syscalls for Win32
LONG __stdcall handler(EXCEPTION_POINTERS * ExceptionInfo) {
HMODULE library;
FARPROC procedure;
DWORD old_esp, return_adress;
if (ExceptionInfo->ExceptionRecord->ExceptionCode != EXCEPTION_ILLEGAL_INSTRUCTION) {
return 0;
}
@kspalaiologos
kspalaiologos / hello.mb
Last active May 10, 2024 07:50
A small hello world in malbolge
(=<`#9]~6ZY327Uv4-QsqpMn&+Ij"'E%e{Ab~w=_:]Kw%o44Uqp0/Q?xNvL:`H%c#DD2^WV>gY;dts76qKJImZ
@kspalaiologos
kspalaiologos / headtp1.py
Created April 7, 2021 15:29
Keep list's head intact, add 1 to the rest.
l=[1, 2, 3, 4]
import random
random.seed(176534382710603018985070461694376330091233904504513008469797409625321738010937873833208573530712592161075505626509892871204904463629472663584546104795791513378309640186065056892649553890588587628266151186823527191548888261345253829583194969458567150594043857230248378854918481204079131730688933383133983520456018192179620400698759545828994067437562288940651432228584077672432938345384025629444382015032260530773201076938172667176401256218722677313570979405835596397754292218504927873301624282921779716474905332998126738522637482919235118067538079152173142358421650307872462803536351332758049445949064417877701872879172592503076919426931540498511977033897041751918824439012554891176085383406602398927169405249558572722277526451855118496676546620123007212731687315828638561939337993269004083228529529941121862343983307450247229980219232116554421760726304414382760806216830223144753642756411985774996502921347276542880677109471858675742274169682474400137869917464172473077573802513284
D'`%^"!=ZZGXyxwSStPr=N.nK+$GGF&ge#"!~,<N)([Zvotm3qpRQ.fNdihg`ed]\"ZB^]V[ZSwW9OTMq4PONGLEDhHG@?>=a`@?>=6Z4z216/.RsP*p.'K+k#G!g%$#"!x>=utsrwvun4lTjoh.fkdib(fHGcb[ZY}|\[ZYR:u8NMLQPIHlLEDIHG@dDCBA@?>76Z{9810Tut,+O/o',+$#G'&%|#"y?>_{tsrwvun4rqSong-Njchafedc\"`_XW{zZYR:uUTSLKonHMLEDCg*)E>CB;_?>=<|{92V65432r*NM-m%*#G'&}e#z!~}v<zyxZpo5slk1inmlkd*Kgfed]#aZB^]V[ZSwW9OTMq4PONGLEDhHG@?>=a`@">=6Z4z2V65432r*NM-m%*#G'&}e#z!~}v<tyrqpon4rqpRQ.lkdib(feG]#aZB^]V[ZSwW9OTMq4PONGLEDhHG@?>=a`@?>=6Z4327654-,P*p.',%$H(h&}$#z@aw=^zsrq7uWmlkjoh.-Njibgf_%cbDC_^W\UyYXQ9UTMqQ3IHMLEihHGFE>=<`#"8=6ZY9y765.-,+O/on,+*#G'gf|B"b~}|{ts9qYotsrk1onPf,dLbgfe^cbaZ~}W?[ZSRvPOTSLKoONGkE-CHAF?cb<$:?876Z{921U54t2+*N.-m%*#G'gf${z@~`_uts9wvotm32pRQ.fNdihg`ed]\"Z_X]VUZSwWVUTSR4o21GLEiIHG@(>b<$:?876Z:9876v.R2r0)(-&J*#"!~DC#zbxw=^zsrq7uWmlkjoh.-Njibgf_%F\a`_^]\[ZSwWVONrR4o2NGFEJCg*)ED=aA@"!7<5Y9876v.R2r0)(-&J*#"!~DCd"!x}v<zyxZpo5Vrqpihg-Njibgf_%cbD`YXW{UTSXQu8NMRQPImlLKDCBfF?>C<A:^>=<|{92V65432r*NM-m%*#G'gf|B"!~}_u;yxwvXnm3qSonmf,diha`e^$Ea`Y^WV[TxXW9OTMq4PO