Skip to content

Instantly share code, notes, and snippets.

View gabamnml's full-sized avatar
:electron:
Focusing

Gabriel Aramburu gabamnml

:electron:
Focusing
View GitHub Profile
@gabamnml
gabamnml / serverup.py
Created January 30, 2012 13:10
Django with Tornado
#! /usr/bin/env python
import os
import tornado.httpserver
import tornado.ioloop
import tornado.wsgi
import sys
import django.core.handlers.wsgi
sys.path.append('/your/project/path/')
def main():
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
@gabamnml
gabamnml / gist:1852979
Created February 17, 2012 12:05
add public key to server
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
@gabamnml
gabamnml / gist:1852992
Created February 17, 2012 12:08
Live view of logs
tail -f log/development.log
@gabamnml
gabamnml / gist:2018804
Created March 12, 2012 00:14
use utf8 characters on Django
Do you have this at the beginning of your script:
# -*- coding: utf-8 -*-
@gabamnml
gabamnml / gist:2307690
Created April 5, 2012 03:14
List of commands for Vim
// Split window on open file
:split filetoopen.py or vertical :vsplit sistema.py
// For navigate on windows intances
Ctrl+w+Arrows or Ctrl+ww
// Show numbers on lines
:set number
// Search & replace
@gabamnml
gabamnml / gist:2351494
Created April 10, 2012 13:46
Django Debug Toolbar conf. for VMware
if DEBUG:
from fnmatch import fnmatch
class glob_list(list):
def __contains__(self, key):
for elt in self:
if fnmatch(key, elt): return True
return False
INTERNAL_IPS = glob_list(['127.0.0.1', '192.168.*.*'])
@gabamnml
gabamnml / eval.rb
Created June 18, 2012 21:53
interactive shell for ruby
#!/usr/local/bin/ruby
#######################################################
#
# Ruby interactive input/eval loop
# Written by matz ([email protected])
# Modified by Mark Slagell ([email protected])
# with suggestions for improvement from Dave Thomas
# ([email protected])
#
@gabamnml
gabamnml / regx.rb
Created June 19, 2012 05:06
test regular expressions in ruby
st = "\033[7m"
en = "\033[m"
while TRUE
print "str> "
STDOUT.flush
str = gets
break
if not str
str.chop!
print "pat> "
@gabamnml
gabamnml / gist:3392147
Created August 19, 2012 04:43
Surf in the terminal
Go to the end of the line: ctrl+e
Go to the beginning of the line: ctrl+a
Move by one letters at a time: ctrl+f (ctrl+b to go backwards)
Move by word alt+f (alt+b to go backwards)
Delete words: alt+d (remember that you need to be in the beginning of the word)
@gabamnml
gabamnml / gist:3452170
Created August 24, 2012 15:46
Add heroku ssh key
heroku keys:add ~/.ssh/id_rsa.pub