Skip to content

Instantly share code, notes, and snippets.

View mytrile's full-sized avatar

Dimitar Kostov mytrile

View GitHub Profile
package main
import (
"unicode/utf8"
)
type Item string
type Stream chan Item
type Acc string
#!/bin/sh
hg purge -v --all
./make.bash
env GOOS=windows ./make.bash --no-clean
env GOOS=windows GOARCH=386 ./make.bash --no-clean
env GOOS=linux ./make.bash --no-clean
env GOOS=linux GOARCH=amd64 ./make.bash --no-clean
env GOOS=linux GOARCH=386 ./make.bash --no-clean
env GOOS=linux GOARCH=arm ./make.bash --no-clean
@mytrile
mytrile / goarena.go
Created January 31, 2013 14:53 — forked from ecin/goarena.go
package main
/*
Ping vs Pong: A Gladiatorial Match
Two goroutines enter, only one leaves...
*/
/*
#cgo LDFLAGS: -lprobes -L/usr/local/lib
#include "probes.h"
package main
import (
"encoding/json"
"fmt"
"github.com/gorilla/sessions"
"io/ioutil"
"log"
"net/http"
"net/url"
@mytrile
mytrile / 0-readme.md
Created November 23, 2012 22:07 — forked from burke/0-readme.md
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@mytrile
mytrile / memo-dyn.txt
Created August 24, 2012 19:13 — forked from fogus/memo-dyn.txt
Memoization vs dynamic programming
Memoization is fundamentally a top-down computation and dynamic
programming is fundamentally bottom-up. In memoization, we observe
that a computational *tree* can actually be represented as a
computational *DAG* (the single most underrated data structure in
computer science); we then use a black-box to turn the tree into a
DAG. But it allows the top-down description of the problem to remain
unchanged.
In dynamic programming, we make the same observation, but construct
the DAG from the bottom-up. That means we have to rewrite the
@mytrile
mytrile / hack.sh
Created August 6, 2012 11:49 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mytrile
mytrile / hack.sh
Created March 31, 2012 10:32 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
➜ tmp ./tilt_test.sh
### SETUP
ruby 1.8.7 (2011-02-18 patchlevel 334) [x86_64-linux]
Initialized empty Git repository in /tmp/tilt_tests/.git/
remote: Counting objects: 1481, done.
remote: Compressing objects: 100% (673/673), done.
remote: Total 1481 (delta 909), reused 1039 (delta 617)
Receiving objects: 100% (1481/1481), 210.99 KiB, done.
Resolving deltas: 100% (909/909), done.
b8587ff2a99a888dd8c6575d008ef91f7888d75b refs/remotes/origin/HEAD
# mongo_template.rb
# remove unneeded defaults
run "rm public/index.html"
run "rm public/images/rails.png"
run "rm public/javascripts/controls.js"
run "rm public/javascripts/dragdrop.js"
run "rm public/javascripts/effects.js"
run "rm public/javascripts/prototype.js"