Skip to content

Instantly share code, notes, and snippets.

View thegeek's full-sized avatar

Francesco Fienga thegeek

  • Nobody Knows ... the trouble i see ...
  • Naples
View GitHub Profile
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
>>> import string
>>> import random
>>> def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
... return ''.join(random.choice(chars) for x in range(size))
...
>>> id_generator()
'G5G74W'
>>> id_generator(3, "6793YUIO")
'Y3U'
@thegeek
thegeek / vimrc
Created November 2, 2013 15:20 — forked from yann2192/vimrc
set shell=/bin/bash
if $TERM == "xterm"
set t_Co=256 " 256 colors
endif
set nocompatible " be iMproved
let mapleader="," " change the leader to be a comma vs slash
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
# download latest libevent2 and tmux sources, and extract them somewhere
# (thx bluejedi for tip on latest tmux URL)
#
# at the time of writing:
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
# http://sourceforge.net/projects/tmux/files/latest/download?source=files
#
# install deps
yum install gcc kernel-devel make ncurses-devel
@thegeek
thegeek / standalone_file.py
Created October 16, 2013 09:37
Using settings without setting DJANGO_SETTINGS_MODULE
from django.conf import settings
settings.configure(DEBUG=True, TEMPLATE_DEBUG=True,
TEMPLATE_DIRS=('/home/web-apps/myapp', '/home/web-apps/base'))
@thegeek
thegeek / Gruntfile.js
Created September 8, 2013 08:22
Load all Grunt Npm Task in one line
...
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
@thegeek
thegeek / .hgrc
Created August 30, 2013 12:07
Mercurial first installation needed step. Create .hgrc file in your user directory.
[ui]
username = forename surname <[email protected]>
verbose = True
@thegeek
thegeek / tip.sh
Created August 15, 2013 19:04 — forked from JeffreyWay/tip.sh
alias gundo='git reset HEAD~ && git clean -df'
@thegeek
thegeek / debug grunt google cdnify
Created August 14, 2013 23:20
Debug Grunt Google CDNify
env DEBUG='google-cdn' grunt cdnify
/* new clearfix */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */