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
rvm --create ruby-1.9.3-p194@gemset_name |
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
RAILS_ENV=production bundle exec rake assets:precompile |
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
class Fixnum | |
def retards_times | |
n = 0 | |
while (n < self) | |
yield n | |
n += 1 | |
end | |
end | |
end |
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
class A | |
class << self | |
def meta_def(method_name, &b) | |
(class << self; self; end).send(:define_method, method_name, &b) | |
end | |
end | |
end | |
#usage : A.meta_def(:test) do |
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
class H < Hash | |
def method_missing(m,*a); | |
m.to_s=~/=$/?self[$`]=a[0]:a==[]?self[m.to_s]:super | |
end | |
undef id, type if ?? == 63 | |
end |
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
for i in `ls ~/python-env`;do alias act_${i}="source ~/python-env/${i}/bin/activate";done |
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 | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
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
from django.db import models | |
class Module(models.Model): | |
title = models.CharField(max_length=200, blank=True, null=True) | |
description = models.CharField(max_length=400, blank=True, null=True) | |
parent = models.ForeignKey('self', blank=True, null=True) | |
def _get_attributes(self): |
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
events.js:74 | |
throw TypeError('Uncaught, unspecified "error" event.'); | |
^ | |
TypeError: Uncaught, unspecified "error" event. | |
at TypeError (<anonymous>) | |
at EventEmitter.emit (events.js:74:15) | |
at EventEmitter.<anonymous> (/usr/local/lib/node_modules/phantom-jasmine/node_modules/walkdir/walkdir.js:189:19) | |
at EventEmitter.g (events.js:175:14) | |
at EventEmitter.emit (events.js:98:17) | |
at statAction (/usr/local/lib/node_modules/phantom-jasmine/node_modules/walkdir/walkdir.js:57:17) |
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
fn main(){ | |
fn re_fac(n: int) -> int { | |
if n < 2 { | |
1 | |
} else { | |
n * re_fac( n - 1 ) | |
} | |
} | |
let num = re_fac(5); | |
println(fmt!("%d",(num))); |
OlderNewer