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
var faye = require('faye'); | |
var client = new faye.Client('http://localhost:8000/'); | |
client.subscribe('/test', console.log); | |
client.publish('/test', 'Hello world.'); |
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
fact :: (Integral a) => a -> a | |
fact f | |
| f == 0 = 1 | |
| otherwise = f*fact (f-1) | |
fac :: (Integral a) => a -> a | |
fac 0 = 1 | |
fac n = n*fac(n-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
det :: (Integral a) => [[a]] -> a | |
det matrix | |
| rows /= cols = -1 | |
| rows == cols = 1 | |
where rows = length (matrix) | |
cols = length (matrix !! 0) |
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
removen :: Int -> [a] -> [a] | |
removen n arr = | |
let (x,y) = splitAt n arr | |
in x ++ tail y |
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
<?php | |
function clean($in) { | |
// I used this function to rename things, since the conversation also required a name change. | |
$out = str_replace("Oldsite", "Newsite", $in); | |
return $out; | |
} | |
$source_database = 'dbname'; |
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
<?php | |
$source_database = 'dbname'; | |
$source_server = 'dbserver'; | |
$source_user = 'dbuser'; | |
$source_pass = 'dbpass'; | |
$source = mysql_connect( $source_server, $source_user, $source_pass ); | |
mysql_select_db($source_database); |
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/bash | |
file=$1 | |
id=$2 | |
echo Making 45x45 | |
convert $1 -resize 45x45^ -gravity center -extent 45x45 ./out/$2-$2-small.jpg | |
echo Making 80x80 | |
convert $1 -resize 80x80^ -gravity center -extent 80x80 ./out/$2-$2-medium.jpg |
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
-- RULES -- | |
~ should be a single .c or .cpp file | |
~ must be written in C or C++ (C is a subset of C++) | |
~ entry must compile (of course) | |
~ must be a deterministic 1-tape TM as defined below | |
~ should accept the input string as a command-line argument (see Links for how to do this) | |
~ upon input, the program should output state:tape followed by a new line | |
~ the program should terminate once the state becomes H,Y, or N. | |
~ the delta function should be changeable (no hard coding the procedure!) | |
~ submissions should have a 'default' delta function that reverses the input string |
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 it use C-a, similar to screen.. | |
unbind C-b | |
unbind l | |
set -g prefix C-a | |
bind-key C-a last-window | |
# Reload key | |
bind r source-file ~/.tmux.conf | |
set -g history-limit 1000 |
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
.aero | |
.asia | |
.biz | |
.cat | |
.com | |
.coop | |
.info | |
.int | |
.jobs | |
.mobi |
OlderNewer