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
# 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 |
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
# 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 |
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, 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; |
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
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? |
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
# 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: |
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
/** 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; |
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
#include <iostream> | |
#include <cstdio> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
struct node{ | |
int val; | |
int despl; | |
node(int i, int j){ | |
val = 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
;;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) |
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
// 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(); | |
} |