This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program YearTenComputerSystemsProjectByBrandonEthakadaAndTaiBellLiu; | |
uses ptccrt, ptcgraph; | |
var keyz : string; | |
selection,speed : integer; | |
procedure InitIt; | |
var gd, gm : integer; | |
begin | |
Gd := d8bit; | |
Gm := m640x480; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/sha1' | |
class Proof < Struct.new :data, :difficulty, :token | |
def valid? | |
hash = Digest::SHA1.hexdigest("#{data} #{difficulty} #{token}") | |
pl = prefix_length(hash.to_i(16)) | |
difficulty <= pl | |
end | |
def increment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PhantomJS doesn't support bind yet | |
Function.prototype.bind = Function.prototype.bind || function (thisp) { | |
var fn = this; | |
return function () { | |
return fn.apply(thisp, arguments); | |
}; | |
}; | |
(function(p) { | |
var fs = require('fs'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'delegate' | |
class Direct | |
def method | |
'direct' | |
end | |
def base | |
'base' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
class Account < Struct.new :balance | |
end | |
class MoneyTransfer < Struct.new :source, :destination | |
def initialize source, destination | |
super | |
source.extend Transferrer | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# hey! a minimalist CRM for http://todotxt.com/ | |
# | |
# hey tells you one thing you should do regularly, but haven't done lately. | |
# | |
# $ todo.sh lf hey | |
# 1 @phone Mom (+1 234 567 8901) +family | |
# 2 @skype Dad +family | |
# 3 @email mentor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <arpa/inet.h> | |
#include <errno.h> | |
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <strings.h> | |
#include <dns_sd.h> | |
void callback(DNSServiceRef sdRef, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NUM_POOLS = 5 | |
Grad = Struct.new :name, :gender, :region | |
def norm_name first, last | |
"#{first.strip} #{last.strip}" | |
end | |
def norm_gender gender | |
{'M' => 'Male', 'F' => 'Female'}[gender] || gender |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# We have a few repeat customers here at the TWU 27 hotdog shack. | |
# | |
# They've decided it's FUN to visit our stand. | |
# | |
# So, we've cooked up something a little special for our valued customers. | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Retarded simple event-binding "DSL" | |
Best with: | |
* jQuery (or Zepto) | |
* event_emitter | |
https://github.com/ajaxorg/ace/blob/master/lib/ace/lib/event_emitter.js | |
Usage: | |
tie($(window), "hashchange") |