Skip to content

Instantly share code, notes, and snippets.

View boramalper's full-sized avatar

Bora M. Alper boramalper

View GitHub Profile
@boramalper
boramalper / Main.hs
Created December 7, 2020 12:56
Brainfuck in Haskell
module Main where
import Data.Char
import qualified Data.Sequence as S
import Data.Word ( Word8 )
import Debug.Trace
import System.Environment
import System.IO
type Cell = Word8
@boramalper
boramalper / README.md
Last active March 5, 2019 11:51
Visualiser for INF-2B Coursework 1 @ The University of Edinburgh

vis.py

for INF-2B Coursework 1

To help determine the x-over point.

example plot

Usage

python3 vis.py matcherTimes.txt
@boramalper
boramalper / recover_source_code.md
Created March 11, 2017 21:18 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@boramalper
boramalper / main.c
Last active August 29, 2015 14:13
Trying to overflow argc
#include <stdio.h>
int main(int argc, char **argv)
{
printf("argc : %d\n", argc);
printf("sizeof(argc) : %zu\n", sizeof(argc));
printf("argv[argc] == NULL: %s\n", argv[argc] == NULL ? "True" : "False");
return 0;
}
@boramalper
boramalper / dhw2ps.pl
Created May 13, 2014 18:15
Convert the .dwh files to .ps or .pdf files
#!/usr/bin/env perl
# -------------------------------------------------------------------------
# file: dhw2ps.pl
# task: convert the internal dwh file format of DigiMemo A501 to
# ps or pdf files
# authors: Jan Theofel ([email protected])
# Harald Koenig
# version: 0.1
# license: free to use, an official license will follow
-- Turkce isimler sozlugu twitter : http://twitter.com/tserpico
CREATE TABLE `isimler` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`isimler` varchar(255) DEFAULT NULL,
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U',
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
-- ----------------------------
@boramalper
boramalper / bafin.c
Created January 25, 2014 20:02
brafin: Brainfuck Interpreter
// not tested
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#define CELL_TYPE uint8_t
#define CELL_COUNT 30000
CELL_TYPE *cell=NULL, *dp=NULL;