This file contains hidden or 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
[user] | |
name = adsdsad | |
email = sdad | |
[alias] | |
ci = commit | |
co = checkout | |
st = status | |
diffindex = diff-index -p -M -b -w --color HEAD | |
This file contains hidden or 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
namespace :aptana do | |
RAILS_APPDIR = RAILS_ROOT.sub("/config/..","") | |
LIBS = %w{rails activerecord actionmailer actionpack | |
actionwebservice activeresource activesupport} | |
def project_name | |
Pathname.new(RAILS_APPDIR).basename.to_s | |
end |
This file contains hidden or 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
runtime! macros/matchit.vim | |
runtime! debian.vim | |
colorscheme torte | |
syntax on | |
:highlight Normal guibg=Black guifg=White | |
if has("autocmd") | |
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | |
\| exe "normal g'\"" | endif |
This file contains hidden or 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
require 'irb/completion' | |
IRB.conf[:SAVE_HISTORY] = 1000 | |
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | |
IRB.conf[:AUTO_INDENT] = true | |
IRB.conf[:PROMPT_MODE] = :SIMPLE |
This file contains hidden or 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
n addGlobalStyle(css) { | |
var head, style; | |
head = document.getElementsByTagName('head')[0]; | |
if (!head) { return; } | |
style = document.createElement('style'); | |
style.type = 'text/css'; | |
style.innerHTML = css; | |
head.appendChild(style); | |
} |
This file contains hidden or 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
#!/usr/bin/ruby | |
RED = "\033[0;31m" | |
RESET = "\033[0m" | |
YELLOW = "\033[0;33m" | |
C = "\033[0;35m" | |
trap("INT") { puts; exit! 127 } | |
def stamp line |
This file contains hidden or 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
=== GGA - Global Positioning System Fix Data === | |
Time, Position and fix related data for a GPS receiver. | |
------------------------------------------------------------------------------ | |
11 | |
1 2 3 4 5 6 7 8 9 10 | 12 13 14 15 | |
| | | | | | | | | | | | | | | | |
$--GGA,hhmmss.ss,llll.ll,a,yyyyy.yy,a,x,xx,x.x,x.x,M,x.x,M,x.x,xxxx*hh<CR><LF> | |
------------------------------------------------------------------------------ |
This file contains hidden or 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 retry(bject): | |
""" | |
Decorator to retry function calls in case they raise exceptions | |
times - retries times (0 means only called once, like this decorator was | |
not used at all) | |
sleep - sleep time to wait aftera failure | |
debug - whether print to stdout info or not | |
""" | |
def __init__(self, times=1, sleep=0, debug=False): | |
self.times = times |
This file contains hidden or 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
import os | |
def touch(fname, times=None): | |
with file(fname, 'a'): | |
os.utime(fname, times) | |
def create_pyshare_symlinks(package): | |
base_subdir = '/'.join(package.split('.')) | |
base_from = '/usr/share/pyshared/' + base_subdir | |
base_to = '/usr/lib/pymodules/python2.7/' + base_subdir |
This file contains hidden or 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
import logging | |
def log_method(fun): | |
""" | |
Example output (it will depend of you logging setup, obviously): | |
2013-02-25 16:13:58+0100 [-] DEBUG:root:--> Foo.update_bar | |
2013-02-25 16:13:58+0100 [-] DEBUG:root:<-- Foo.update_bar (0.052) | |
""" | |
def with_logging(self, *args, **kwargs): | |
method_name = '%s.%s' % (self.__class__.__name__, fun.__name__) |
OlderNewer