Skip to content

Instantly share code, notes, and snippets.

use common::*;
//common not included, it has declarations for opaque c-structs etc.
extern {
pub fn app_event_loop();
// ...
}
Array.prototype.remove = (e) ->
i = this.indexOf(e)
this.splice(i,1) if i != -1
edges = ((-1 for i in [0..10]) for i in [0..10])
edges[0][2] = 1
edges[0][3] = 2
edges[3][4] = 4
edges[0][4] = 5
@andars
andars / fail.py
Last active August 29, 2015 14:09
import matplotlib.pyplot as plt
from time import time
from random import random
from maximum_subarray import *
from sorts import *
def plot_times(functions, inputs):
for fn in functions:
times = []
for i in inputs:
@andars
andars / grade.rb
Last active August 29, 2015 14:09
#!/usr/bin/env ruby
if ARGV[0].nil?
puts "filename required"
exit
end
if ARGV[0][0..1] != 'pr'
puts "very fail: please follow naming convention of psXX.[filetype]"
exit
function test begin
call test
end
call test
public class LinkedList<T> {
private Node<T> head;
private Node<T> tail;
private int length = 0;
LinkedList() {
}
public void push(T val) {
Node<T> curr;
.PHONY: run
writer: main.c main.S
clang $^ -o $@
run:
./writer
#include <malloc/malloc.h>
#include <stdio.h>
#include <objc/runtime.h>
//#import <Foundation/Foundation.h>
@interface Test
- (void) sayHello;
+ (id) alloc;
@andars
andars / nonsensitize.py
Last active August 29, 2015 14:01
The English Obfuscator
#! /usr/bin/env python3
vowels = ['a','e','i','o','u']
garbage = ['ae', 'uh', 'eu', 'iy', 'eo', 'ua']
choices = vowels + garbage
for i in range(4):
choices = choices + choices
sent = input()
result = ""
@andars
andars / test.md
Created May 12, 2014 03:20
mkdown_test

##Header?

Here we go!