Skip to content

Instantly share code, notes, and snippets.

@phase
phase / errors.txt
Created July 10, 2016 20:32
LLVM needs some documentation
no such function `.�h.�h.�!(7�
!�5��.�H.�!�6��.�!.�1�6�*��.��.��.�!�-�1�6�@.��/��/��/�1@5�x86-winehstate0!(7�
!�5��/�x/�!�6�0�!0/�1�6�p+��/��/��/�!�.�10�Hello, world!!�6�0�!�5��0�x0�!@5���▒� 1�6�p/��0��0��0�!00�QP*��-� .�P/�P0�Generating code for 11NMethodCall
tatement
r
Q����� z]��]�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� z]@5�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������AA����������x���@0=�0=�0=�0=�0=�0=0=�����������/�o�xmQ�:�P�����!dbg1tbaa0!P=�p=�p=��P��������������������������z�@,]�E�@@,]�G�@p,]�I�@▒k�
@phase
phase / shell.c
Created July 14, 2016 23:37 — forked from parse/shell.c
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
@phase
phase / std.io
Created July 15, 2016 06:52
pasting markdown into a terminal and random files get created
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7EFEBE7
@phase
phase / oop.bf
Created July 16, 2016 06:32
Maybe OOP Brainfuck code
++++[>+++++<-]>+++
[
[>+>+<<-]
>++++++[<+>-]+++++++++[<++++++++++>-]
>[<+>-]<-
]
+++>+++++++++[<+++++++++>-]
>++++++[<++++++++>-]<--[>+>+<<-]>>[<<+>>-]<--
>>++++[<++++++++>-]++++++++++
@phase
phase / ops.ml
Last active July 24, 2016 22:18
open Printf
let add () =
let a = Stack.pop Objects.stack in
let b = Stack.pop Objects.stack in
(*
if (a is Int and b is Int) {
a + b
}
else if (a is Int and b is String) {
@phase
phase / bf.ml
Created July 25, 2016 04:36 — forked from darkf/bf.ml
Brainfuck interpreter in OCaml
let eval str =
let cells = Array.make 4096 0 in
let ptr = ref 0 in
let len = String.length str in
let rec evalbf c =
if c >= len then
c
else
match String.get str c with
make unix
mkdir -p bin
mkdir -p build
g++ -std=c++11 src/main.cpp src/command/commandbase.cpp src/command/commandlist.cpp src/context/treeitem.cpp src/dict/dict.cpp -o bin/storyboard-test
In file included from src/main.cpp:3:0:
src/standard.hpp: In function ‘void st::clearCin()’:
src/standard.hpp:14:19: error: ‘numeric_limits’ is not a member of ‘std’
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
^
src/standard.hpp:14:54: error: expected primary-expression before ‘>’ token
@phase
phase / decomposing_boolean_algebra.txt
Created August 27, 2016 01:02
Decomposing Boolean Algebra
Not(a) = Nand(a,a)
And(a,b) = Not(Nand(a,b))
Or(a,b) = Not(And(Not(a),Not(b)))
Xor(a,b) = Or(And(a,Not(b)),And(Not(a),b)))
Or(a, b) =
Nand( //Not
Nand( //And
Nand(Nand(a, a), Nand(b, b)), //First And input
Nand(Nand(a, a), Nand(b, b)) //Second And input
@phase
phase / commit_ahead.sh
Created September 26, 2016 06:16
Commit a day ahead
git commit -S -s -v -m "`date --date='1 day'`" --date="`date --date='1 day'`" -m "$(git status | grep -P '\t')"
@phase
phase / git_structure.txt
Last active October 5, 2016 01:46
Git Repository Structure
zlib files can be decompressed using
printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" |cat - <file> | gzip -dc
.git/HEAD contains a ref (HEAD can also contain a commit, which makes it a "detached HEAD")
ref: refs/heads/master
.git/refs/heads/master contains a commit object