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
sudo apt-get install libxapian-dev uuid-dev | |
# enter virtualenv (ej.: workon myvirtualenv, source ~/env/bin/activate) | |
pkgver=1.2.16 | |
mkdir -p $VIRTUAL_ENV/src && cd $VIRTUAL_ENV/src | |
curl -O http://oligarchy.co.uk/xapian/$pkgver/xapian-core-$pkgver.tar.xz && tar xf xapian-core-$pkgver.tar.xz | |
curl -O http://oligarchy.co.uk/xapian/$pkgver/xapian-bindings-$pkgver.tar.xz && tar xf xapian-bindings-$pkgver.tar.xz |
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/env bash | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: ./savegames.sh <dest-folder>" | |
exit | |
fi | |
BACKUP_FOLDER=$1 | |
echo $BACKUP_FOLDER |
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
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | |
PROJECT_ROOT = os.path.join(os.path.join(BASE_DIR, '..'), '..') | |
LOCALE_PATHS = ( | |
os.path.join(PROJECT_ROOT, 'conf', 'locale'), | |
'/path/to/project/conf/locale' | |
) | |
LANGUAGES = ( | |
('es', 'Spanish'), |
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
# - Find Aruco | |
# Find the native Aruco includes and libraries | |
# | |
# Aruco_INCLUDE_DIR - where to find Aruco headers. | |
# Aruco_LIBRARIES - libraries needed for linking Aruco. | |
# Aruco_FOUND - True if libaruco was found. | |
if(Aruco_INCLUDE_DIR) | |
# Already in cache, be silent | |
set(Aruco_FIND_QUIETLY TRUE) |
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
# create db and provide initial data | |
./manage.py syncdb | |
./manage.py migrate | |
./manage.py loaddata fixture.json |
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
# python | |
somevar = request.META.get('HTTP_AUTH', None) | |
# curl | |
curl -H 'AUTH:1234' http://127.0.0.1:8000/some/url/ | |
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
"http://nvie.com/posts/how-i-boosted-my-vim/ | |
" load plugins | |
call pathogen#infect() | |
set guifont=Consolas\ 10 | |
set nocp | |
filetype on | |
filetype plugin on |
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
local lfs = require "lfs" | |
-- get all images in a path (there should be only images in this path) | |
wp_files = {} | |
wp_path = "/EDIT/THIS/PATH/" | |
for file in lfs.dir(wp_path) do | |
if file:sub(1,1) ~= '.' then | |
table.insert(wp_files,file) | |
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
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h: \[\e[33m\]\w\[\e[0m\]\n\$ ' |
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 urllib2 | |
import json | |
import sys | |
def addr_to_url(addr): | |
return "http://nominatim.openstreetmap.org/?format=json&addressdetails=1&q=" + addr.strip().replace(" ", "+") + "&format=json&limit=1" | |
def addr_to_geo(addr): | |
url = addr_to_url(addr) | |
jsonreq = urllib2.urlopen(url).read() |