Skip to content

Instantly share code, notes, and snippets.

🍰
cupcake

Christopher Swenson swenson

🍰
cupcake
Block or report user

Report or block swenson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@swenson
swenson / helloworld.bf
Created Jun 7, 2017
Hello World in BF, made in a diff with only line deletions
View helloworld.bf
+
+
+
+
+
+
+
+
[
>
@swenson
swenson / life.py
Last active Apr 27, 2017
Game of Life in Rust and Python
View life.py
from pprint import pprint
import random
def nextgen(state):
new_state = []
for i in range(5):
new_state.append([0] * 5)
for x in range(5):
@swenson
swenson / rlwe-integers.ipynb
Created Dec 24, 2016
This notebook performs computations from "Fully Homomorphic Encryption over the Integers" by van Dijk, Gentry, Halevi, and Vaikuntanathanm, which can be found at https://eprint.iacr.org/2009/616.pdf
View rlwe-integers.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@swenson
swenson / explore.py
Created Aug 10, 2016
Ctags + Pygments static source generator
View explore.py
from collections import defaultdict
import json
import os
import os.path
import shutil
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_for_filename
from pygments import highlight
@swenson
swenson / segfault.py
Created Jul 13, 2016
Segfault Python 2.7.11 (mac) by adding numbers
View segfault.py
This file has been truncated, but you can view the full file.
def f():
a0 = 0
a1 = 1
a2 = 2
a3 = 3
a4 = 4
a5 = 5
a6 = 6
a7 = 7
@swenson
swenson / repro.chpl
Created Mar 28, 2016
Tuple destructor: formal count does not match argument count
View repro.chpl
proc f() : (int, int) {
return f();
}
proc main() {
f();
}
View repro.chpl
proc f() : (int, int) {
return f();
}
proc main() {
f();
}
@swenson
swenson / backup.sh
Created Aug 12, 2015
Install tarsnap. Then, here's some stuff.
View backup.sh
#!/bin/bash
NAME="something"
d=$(date "+%F--%H-%M-%S")
/usr/local/bin/tarsnap -c --keyfile /root/tarsnap.key --cachedir /usr/local/tarsnap-cache -f $NAME-backup-$d /etc /home /root /var
@swenson
swenson / debug.asm
Created Apr 25, 2015
A 6502 disassembler and debugger (written as part of a NES emulator)
View debug.asm
do_a_trap
mov esi, [trap]
test esi, 0x10000
jnz normal_trap
test esi, 0x20000
jnz register_trap
jmp near return_no_cigar
normal_trap
cmp si, [_PC]
jnz near return_no_cigar
@swenson
swenson / Swenson & Poppies.tmTheme
Created Apr 12, 2015
Swenson & Poppies Sublime Text theme, based on Slush & Poppies.
View Swenson & Poppies.tmTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>author</key>
<string>William D. Neumann</string>
You can’t perform that action at this time.