Skip to content

Instantly share code, notes, and snippets.

View nhocki's full-sized avatar
💭
I may be slow to respond.

Nicolás Hock-Isaza nhocki

💭
I may be slow to respond.
View GitHub Profile
# Enable color support of ls and also add handy aliases
alias ls='ls --color=auto'
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# some more ls aliases
@nhocki
nhocki / gist:437255
Created June 14, 2010 03:46 — forked from dhh/gist:45076
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
def test_slicing_arrays
array = [:peanut, :butter, :and, :jelly]
assert_equal [:peanut], array[0,1]
assert_equal [:peanut, :butter], array[0,2]
assert_equal [:and, :jelly], array[2,2]
assert_equal [:and, :jelly], array[2,20]
assert_equal Array.new, array[4,0]
assert_equal Array.new, array[4,100]
assert_equal nil, array[5,0] # wtf?
# Why is it nil?
# Spanish as spoken in Colombia (es-CO) translations for Rails
# by Christian A. Rojas G (christianrojas@mac.com)
# Taken from http://github.com/svenfuchs/rails-i18n/blob/master/rails/locale/es-CO.yml
es-CO:
number:
percentage:
format:
delimiter: ","
currency:
/** Creates an edge from u to v. This represents that task u comes before task v **/
void add_edge(int u, int v){
g[u].push_back(v);
d[v]++;
}
int d[MAXN]; //d[i] is the number dependencies
vector<int> top_sort(graph &g, int *d){
vector<int> order;
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
struct node{
int val;
int despl;
node(int i, int j){
val = i;
;;Load path
(setq load-path(cons(expand-file-name "~/.emacs.d/lisp")load-path))
(require 'template)
(require 'linum) ;; Line numbers
(require 'color-theme)
(color-theme-initialize)
(color-theme-dark-laptop)
// Taken from http://forr.st/~1L3
function resizer() {
this.resize = function(element, size) {
this.init(element);
element.css('font-size', this.growTo(size) + 'px');
this.tester.remove();
}