start new:
tmux
start new with session name:
tmux new -s myname
| /* | |
| --- | |
| name: kenta.Private | |
| description: Private mootator for MooTools 1.3.x | |
| license: MIT-style license. | |
| copyright: Carlesso Cristian http://mykenta.blogspot.com |
| Function.overload = function(fns, thisArg){ | |
| var dflt = (typeOf(fns[fns.length - 1]) == 'function') ? fns.pop() : null; | |
| return function(){ | |
| var args = Array.from(arguments), | |
| self = thisArg || this; | |
| overload: for (var i = 0, l = fns.length; i < l; i++){ | |
| var types = fns[i].slice(0, -1), length = types.length, | |
| fn = fns[i][length]; |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| // Tile server using the node web framework Express (http://expressjs.com). | |
| var app = require('express').createServer(); | |
| var tilelive = require('tilelive'); | |
| require('tilelive-mapnik').registerProtocols(tilelive); | |
| var filename = __dirname + '/' + 'stylesheet.xml'; | |
| tilelive.load('mapnik://' + filename, function(err, source) { | |
| if (err) throw err; | |
| app.get('/:z/:x/:y.*', function(req, res) { | |
| source.getTile(req.param('z'), req.param('x'), req.param('y'), function(err, tile, headers) { | |
| // `err` is an error object when generation failed, otherwise null. |
| /** | |
| * Wraps a `Function` with another `Function`. This allows | |
| * the wrapper function to intercept and manipulate the | |
| * return value of the orginal function. | |
| * @param {Function} fn The function to wrap | |
| * @param {Function} wrapper The wrapper function | |
| * @return {Function} Return the wrapped function | |
| */ | |
| function wrap(fn, wrapper) { | |
| return function() { |
The difference between XYZ and TMS tiles and how to convert between them
Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles
ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like
&z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.
Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.
Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.
| var map = L.map( 'map' ); | |
| L.Map.prototype.panToOffset = function (latlng, offset, options) { | |
| var x = this.latLngToContainerPoint(latlng).x - offset[0] | |
| var y = this.latLngToContainerPoint(latlng).y - offset[1] | |
| var point = this.containerPointToLatLng([x, y]) | |
| return this.setView(point, this._zoom, { pan: options }) | |
| } | |
| function centerMap(){ |
Detailed walk through of building extraction using postgis
First lets pull a data layer from of openstreetmap. You can do this any which way you’d like, as there are a variety of methods for pulling openstreetmap data from their database. Check the [wiki] (http://wiki.openstreetmap.org/wiki/Downloading_data) for a comprehensive list. My favourite method thus far is pulling the data straight into QGIS using the open layers plugin. For those who may want to explore this method, check [this tutorial] (http://www.qgistutorials.com/en/docs/downloading_osm_data.html). For building extraction you only need building footprints, and include the building tags. Not all polygons are of type building in OSM, so we can download all the polygons, and then filter the layer for only polygons tagged as buildings.
LiDAR data was pulled from USGS via the Earth Explorer site. [Here] (http://earthobservatory.nasa.gov/blogs/ele
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent