Author: Sean Gillies Version: 1.0
This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
This file remaps the key bindings of a single user on Mac OS X 10.5 to more | |
closely match default behavior on Windows systems. This makes the Command key | |
behave like Windows Control key. To use Control instead of Command, either swap | |
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys... | |
or replace @ with ^ in this file. | |
Here is a rough cheatsheet for syntax. | |
Key Modifiers |
from djangobb_forum.models import Post | |
from django.db.models import Max | |
# id__max is None if there are no Posts in the database | |
id_max = Post.objects.all().aggregate(Max('id'))['id__max'] | |
id_next = id_max + 1 if id_max else 1 |
// Needed in AndroidManifest: | |
<!-- Permission for using NFC hardware --> | |
<uses-permission android:name="android.permission.NFC"/> | |
<!-- Forcing device to have NFC hardware --> | |
<uses-feature android:name="android.hardware.nfc" android:required="true"/> | |
<!-- Registering app for receiving NFC's TAG_DISCOVERED intent --> | |
<intent-filter> | |
<action android:name="android.nfc.action.TAG_DISCOVERED"/> | |
<category android:name="android.intent.category.DEFAULT"/> | |
</intent-filter> |
# run this as root | |
while [ 1 ]; do echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload; done | |
# or as an upstart job | |
script | |
echo | nc -l -U /tmp/reload_nginx && /etc/init.d/nginx reload | |
end script | |
respawn | |
# now any process can run this or do the equivalent with sockets to trigger reload |
# Install subversion | |
sudo apt-get -y install subversion | |
# Install g++ | |
sudo apt-get -y install g++ | |
# Install Hierarchical Data Format library | |
# NOTE: This library is not necessarily needed, but was required | |
# in order for this to compile against a clean Ubuntu 12.04 LTS system. | |
# I didn't need it on a clean EC2 Ubuntu 12.10 instance, so |
// Handy function to render dynamic parameters in a dust.js helper | |
function renderParameter(name, chunk, context, bodies, params) { | |
if (params && params[name]) { | |
if (typeof params[name] === "function") { | |
var output = ""; | |
chunk.tap(function (data) { | |
output += data; | |
return ""; | |
}).render(params[name], context).untap(); | |
return output; |
"""Distance helpers.""" | |
import math | |
EARTH_CIRCUMFERENCE = 6378137 # earth circumference in meters | |
def great_circle_distance(latlong_a, latlong_b): | |
""" |
Number.prototype.plural = function(){ | |
if(this > 1 || this == 0){ | |
return true; | |
} else { | |
return false; | |
} | |
} | |
String.prototype.pluralize_rules = function(){ | |
return [[new RegExp('$', 'gi'), 's']]; |
[ | |
{ "keys": ["ctrl+shift+e"], "command": "open_folder_in_explorer" } | |
] |