Skip to content

Instantly share code, notes, and snippets.

View gduverger's full-sized avatar

Georges Duverger gduverger

View GitHub Profile
pythonX.X manage.py dumpdata -e contenttypes > app/dumps/…
@gduverger
gduverger / gist:8b5bc3962a65eec48d61
Created August 11, 2014 00:37
Empty file from command line
cat /dev/null > file.txt
@gduverger
gduverger / gist:c2045eca44d2fc4ec044
Last active August 29, 2015 14:06
Find and kill a process
ps aux | grep gunicorn
kill -9 PID
@gduverger
gduverger / gist:4cecbfad3de227626678
Last active August 29, 2015 14:06
Git stashing
git stash
git stash list
git stash apply
git stash apply stash@{2}
git stash clear
// http://git-scm.com/book/en/Git-Tools-Stashing
git submodule add [repo.git] [repo]
(git submodule init)
git submodule update
cat .gitmodules
// http://git-scm.com/book/en/Git-Tools-Submodules
;( function( $, window, undefined ) {
var $body;
$( function() {
$body = $( "body" );
}
})( jQuery, window );
@gduverger
gduverger / gist:e2f6d8ac969bf79ba0cc
Created October 27, 2014 22:00
Python command line script
#!/usr/bin/python
import sys
def main(argv):
print("main")
if __name__ == "__main__":
main(sys.argv[1:])
\list # lists all databases
create database database_name; # create a database
DROP DATABASE database_name; # drop database
\c db_name # connect to a certain database
\dt # lists all tables in the current database
\d table_name # view table
DROP TABLE table_name; # drop table
\q # exit
@gduverger
gduverger / correlations.txt
Last active August 29, 2015 14:10
1st attempt at quantifying my weight fluctuations per food item
1. "pea" +1.716lb
2. "onion" +1.681lb
3. "grape" +0.685lb
4. "tomato" +0.372lb
5. "champagne" +0.104lb
6. "arugula" +0.093lb
7. "chicken" +0.092lb
8. "ricotta" +0.089lb
9. "cannoli" +0.086lb
10. "pancetta" +0.074lb
@gduverger
gduverger / gist:2b72aa0bdb39ddce5b06
Last active August 29, 2015 14:13
JavaScript module
/*global window, jQuery */
( function( $, window, undefined ) {
/**
* --------------------------------- VARS ---------------------------------
*/
var module,
DEFAULTS = {