Author: Sean Gillies Version: 1.0
This document describes a GeoJSON-like protocol for geo-spatial (GIS) vector data.
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| [ | |
| { "keys": ["ctrl+shift+e"], "command": "open_folder_in_explorer" } | |
| ] |
| Number.prototype.plural = function(){ | |
| if(this > 1 || this == 0){ | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } | |
| String.prototype.pluralize_rules = function(){ | |
| return [[new RegExp('$', 'gi'), 's']]; |
| """Distance helpers.""" | |
| import math | |
| EARTH_CIRCUMFERENCE = 6378137 # earth circumference in meters | |
| def great_circle_distance(latlong_a, latlong_b): | |
| """ |
| // 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; |
| # 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 |
| # 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 |
| // 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> |
| 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 |