Skip to content

Instantly share code, notes, and snippets.

View caasi's full-sized avatar
🐫
Learning OCaml

Isaac Huang caasi

🐫
Learning OCaml
View GitHub Profile
@caasi
caasi / .tmux.conf
Created June 16, 2012 10:56
tmux config
set -g utf8 on
setw -g utf8 on
setw -g mode-keys vi
# status bar
set status on
set -g status-bg default
set -g status-fg colour33
set -g status-justify centre
set -g status-left '[ #H ]'
@caasi
caasi / rounded_box_gist.css
Created June 16, 2012 11:35 — forked from cowboycoded/rounded_box_gist.css
styles for rounded box gist
.gist{
margin: 15px 0 !important;
}
.gist-file{
border: none !important;
}
.gist-meta{
background-color: #1D1D1D !important;
@caasi
caasi / .screen
Created June 16, 2012 11:37
screen config
# Turn off the startup message.
startup_message off
# Hardstatus
hardstatus alwayslastline
hardstatus string '%{= .W}[ %H ][%=%? %-W%?%{= .r} * %t%{= .W}%+w%=]'
# New screens
screen -t run 1 bash
screen -t main 0 bash
@caasi
caasi / imagination.js
Created June 16, 2012 11:39
imagination
var f = function() {
var __kind = "O";
return function(name) {
// private things here
var _vars = {};
_vars["kind"] = function() {
return __kind;
};
_vars["name"] = name || "anonymous";
@caasi
caasi / moar_imagination.js
Created June 16, 2012 11:56
imagination in action
f = () {
return (name) {
@@kind = "O";
@kind = () {
return __kind;
};
@name = name || "anonymous";
return $;
};
};
@caasi
caasi / .vimrc
Created July 19, 2012 05:41
my .vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
Bundle 'gmarik/vundle'
" my bundles
@caasi
caasi / gist:3237372
Created August 2, 2012 14:15
jitsu error
info: Creating snapshot 0.1.1-14
info: Updating app thRee
info: Activating snapshot 0.1.1-14 for thRee
info: Starting app thRee
error: Error running command deploy
error: socket hang up
error: Error: socket hang up
error: at createHangUpError (http.js:1253:15)
error: at CleartextStream.socketCloseListener (http.js:1304:23)
error: at CleartextStream.EventEmitter.emit (events.js:115:20)
@caasi
caasi / 1st and 2nd
Created August 14, 2012 17:29
deploy without stop first
info: Creating snapshot 0.1.1-7
info: Updating app life
info: Activating snapshot 0.1.1-7 for life
info: Starting app life
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
warn: Error returned from Nodejitsu
error: Error: connect ECONNREFUSED
error: at errnoException (net.js:768:11)
error: at Object.afterConnect [as oncomplete] (net.js:759:19)
@caasi
caasi / javascript_chat_actor_function
Created August 25, 2012 19:04
actor and function
02:03 < Lajla> When they first made scheme, they had support for both functions and actors, and to their surprise they found
out that while they were doing it, the code for functions and actors turned out to be identical
02:03 < Mortchek> Heheh.
02:03 < Lajla> So they dropped actors and it eventually became the continuation passing style.
02:04 < Mortchek> So if we assume that any sort of value is an actor that accepts certain messages, and an actor passed a
message yields another actor, then… everything is a function!
02:05 < Mortchek> We've just come back around to lambda calculus.
02:06 < Lajla> That's the general gist in fact of this revalation
02:07 < Lajla> that the actor model and lambda calculus are one and the same.
02:07 < Lajla> And can be described in terms of each other.
@caasi
caasi / tohit2_ranged.c
Created August 26, 2012 17:01
fo2 pseudo code ez version
int apply_distance_modifier() {
attack_is_ranged = 1;
int mod;
int new_perception = attacker_is_player ? attacker_perception - 2 : attacker_perception;
int dist = target_invalid ? 0 : distance_between_attacker_and _target;
switch(weapon_perk) {
case long_range:
mod = (new_perception * 4 - dist) * 4;