##General:
- [Package Control] (http://wbond.net/sublime_packages/package_control/installation) (make installing other packages easier)
- AdvancedNewFile
- SideBarEnhancements
- Git
- GitGutter
- DocBlockr
| // String utils | |
| // | |
| // resources: | |
| // -- mout, https://github.com/mout/mout/tree/master/src/string | |
| /** | |
| * "Safer" String.toLowerCase() | |
| */ | |
| function lowerCase(str) { | |
| return str.toLowerCase(); |
| class Point | |
| constructor: (@x = 0, @y = 0) -> | |
| if isNaN(@x) or isNaN(@y) | |
| throw new Error('Invalid coords') | |
| add: (point) -> | |
| @x += point.x | |
| @y += point.y | |
| subtract: (point) -> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Queueing Asynchronous Functions in JavaScript</title> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
| <script type="text/javascript" src="queue.js"></script> | |
| </head> | |
| <body> | |
| <p><input type="button" id="process-button" value="Process Queue" /></p> | |
| <div id="output"></div> |
| /* | |
| # GEOJSON TILE LAYER IN LEAFLET.JS | |
| The original idea for this gist comes from Koko A.'s post on leaflet-js google groups | |
| (https://groups.google.com/forum/#!msg/leaflet-js/d7ur-evSz7Q/p_B4ea_0K1AJ) | |
| Use it at your own peril (• | |
| ## The basic concept | |
| - setup the map and the tiles as usual | |
| - respond to the "tileload" event with a function that loads the json file (that has the same name - z, x, y - as the tile) |
##General:
| /* Mobile First! */ | |
| body { | |
| font-size: 100%; | |
| } | |
| #header { | |
| padding: 12px 3.75%; /* (12 / 320) * 100 = 3.75 */ | |
| } | |
| #title h1 { | |
| font-size: 2em; /* (32 / 16) * 100 = 2 */ | |
| line-height: 1em; |
| var canvasElem = document.getElementById("game"); | |
| var world = boxbox.createWorld(canvasElem); | |
| world.createEntity({ | |
| name: "player", | |
| shape: "circle", | |
| radius: 1, | |
| image: "pig.png", | |
| imageStretchToFit: true, | |
| density: 4, |
| function toWKT(layer) { | |
| var lng, lat, coords = []; | |
| if (layer instanceof L.Polygon || layer instanceof L.Polyline) { | |
| var latlngs = layer.getLatLngs(); | |
| for (var i = 0; i < latlngs.length; i++) { | |
| latlngs[i] | |
| coords.push(latlngs[i].lng + " " + latlngs[i].lat); | |
| if (i === 0) { | |
| lng = latlngs[i].lng; | |
| lat = latlngs[i].lat; |
| var require = function (file, cwd) { | |
| var resolved = require.resolve(file, cwd || '/'); | |
| var mod = require.modules[resolved]; | |
| if (!mod) throw new Error( | |
| 'Failed to resolve module ' + file + ', tried ' + resolved | |
| ); | |
| var cached = require.cache[resolved]; | |
| var res = cached? cached.exports : mod(); | |
| return res; | |
| }; |
These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):
Install Raspbian - http://www.raspberrypi.org/downloads
Install the necessary dependecies:
sudo apt-get install git-core build-essential(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)