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
for a in /Applications/*; do | |
base=`echo $a | sed 's/\/Applications\/\(.*\)\.app/\1/'` | |
if [ $base != $a ]; then | |
name=`echo ${base:l} | sed 's/[^a-z0-9_]/\-/g'` | |
alias $name="\"/Applications/$base.app/Contents/MacOS/$base\"" | |
fi | |
done |
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
function async (fun, args) { | |
if(!fun.length) return; | |
args = args || []; | |
var call=fun.shift(); | |
if(typeof call == "function") call = [ call ]; | |
var count=call.length; | |
var n=0; | |
var ret=[]; | |
while(call.length) { | |
call.shift().apply((function (num){ |
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
<html> | |
<head> | |
<title>Chat</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> | |
<script> | |
$(function () { | |
function check () { | |
$("#output").load('/update', function () { | |
setTimeout(check, 1); | |
}); |
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
import urllib | |
import re | |
import os | |
path = "./" | |
i = 1 | |
content = True | |
while content: | |
dir = os.listdir(path) | |
for file in dir: |
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
function BF (code, get, print) { | |
eval("var i=0,d={0:0};"+code.replace(/[^\[\]\-\+\,\.\<\>]/g, "").replace(/\]/g, "}").replace(/\[/g, "while(d[i]) {").replace(/\-/g, "d[i]--;").replace(/\+/g, "d[i]++;").replace(/\</g, "i--;d[i]=d[i]?d[i]:0;").replace(/\>/g, "i++;d[i]=d[i]?d[i]:0;").replace(/\,/g, "d[i]=get();").replace(/\./g, "print(d[i]);")); | |
} |
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
faster(X,Y) :- faster(X,Z), faster(Z,Y). | |
eat(X,Y) :- faster(X,Y), carnivore(X). | |
eat(lion, zebra). | |
faster(zebra, dog). | |
carnivore(dog). | |
% then I try | |
eat(lion, X). % and I only get zebra |
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
// the time between bits about 9600 bauds | |
#define bitDelay 101 | |
void printByte(char out) { | |
digitalWrite(7, HIGH); // start bit | |
delayMicroseconds(bitDelay); | |
for(char mask=0x01; mask; mask <<=1) { | |
digitalWrite(7, out & mask ? HIGH : LOW); // I am not sure which way this should go | |
delayMicroseconds(bitDelay); |
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
# make a little code system using a lot of dir | |
sub makeMess { | |
my $dep = shift; | |
if ($dep != 0) { | |
for(my $c=0; $c<10; $c++) { | |
mkdir("$c"); | |
chdir("$c"); | |
makeMess($dep-1); | |
chdir(".."); |
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
// http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml | |
#ifndef ANALOGLITERALS_HPP | |
#define ANALOGLITERALS_HPP | |
namespace analog_literals { | |
typedef unsigned int uint; | |
// Symbols |
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 - | |
"exec" "python" "-O" "$0" "$@" | |
__doc__ = """Tiny HTTP Proxy. | |
This module implements GET, HEAD, POST, PUT and DELETE methods | |
on BaseHTTPServer, and behaves as an HTTP proxy. The CONNECT | |
method is also implemented experimentally, but has not been | |
tested yet. |