Skip to content

Instantly share code, notes, and snippets.

View javier's full-sized avatar

javier ramírez javier

View GitHub Profile
@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@burnash
burnash / get_oauth2_token.py
Last active August 11, 2021 21:16
Simple command line script to fetch a Google API's access token.
'''
This script will attempt to open your webbrowser,
perform OAuth 2 authentication and print your access token.
It depends on two libraries: oauth2client and gflags.
To install dependencies from PyPI:
$ pip install python-gflags oauth2client
@fxn
fxn / atomic_redis_extensions_with_lua.md
Created December 11, 2012 18:55
Atomic Redis Extensions with Lua

Atomic Redis Extensions with Lua

Redis has a very simple execution model: while the server is evented and is able to cope with many concurrent clients, the commands themselves are executed one after the other. Redis is single-threaded. So, you know that while a LPUSH runs, say, no other command can possibly read or change anything at the same time.

If you open a transaction with MULTI, the commands of the transaction are queued, and when the transaction is committed, the queued commands run atomically. No other clients are served while they run because EXEC, as the rest of ordinary commands, is executed in that single thread. Other clients may be served while the commands are queued though, and that gives place to optimistic idioms with WATCH.

Redis 2.6 comes with support for Lua scripting, and that yields new options. because **Lua script

@javier
javier / gist:4071356
Created November 14, 2012 10:14 — forked from eLafo/install.txt
My (elafo) install notes for ubuntu. Must be reviewed, but in the meanwhile... it's ok for me
# Update System
# ------------------------------------------------------------------------------
echo 'Updating System...'
sudo apt-get -y update
# Hardware
# ------------------------------------------------------------------------------
echo 'Installing bumblebee'
sudo add-apt-repository -y ppa:bumblebee/stable && sudo apt-get update
sudo apt-get -y install bumblebee bumblebee-nvidia
@malarkey
malarkey / Contract Killer 3.md
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………