Skip to content

Instantly share code, notes, and snippets.

View Rub21's full-sized avatar
🐕

Ruben L. Mendoza Rub21

🐕
View GitHub Profile
@Rub21
Rub21 / gist:4225359
Created December 6, 2012 15:32 — forked from rolo/gist:1481128
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@Rub21
Rub21 / SUBLIME TEXT2 INSTALLATION
Last active October 13, 2015 18:57 — forked from devudilip/SUBLIME TEXT2 INSTALLATION
HOW TO INSTALL SUBLIME TEXT 2 ON UBUNTU 11.10
#BECOME SUPER USER#
sudo -i
#add sublime to repository#
add-apt-repository ppa:webupd8team/sublime-text-2
#update#

perf guide

Profiling tools are critical for trying to understand performance bottlenecks in code.

Without real data about what a program is doing while running, detecting bottlenecks is at best a process of trial and error for both users and developers. While thoughtful testing of various program configurations along with measuring time elapsed for decrete runs can often be enough - why not learn faster and funner ways to rapidly collect real data about what a program is doing?

Actual data about program execution like which functions are being called while a program is active helps point to hot parts of the code where most time may be being spent. While users of applications may not easily understand the output of profiling tools, being equipped to generate profiling output can be extremely useful for sharing with developers, since the time to set up robust test cases for developers is can be greater than the time it takes to understand and optimize slow code paths. Therefore it can be invaluable to get

@Rub21
Rub21 / index.html
Created January 11, 2013 15:52 — forked from yhahn/index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.6/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
@Rub21
Rub21 / index.html
Created January 31, 2013 04:39 — forked from tmcw/index.html
<!DOCTYPE html>
<html>
<head>
<script src='http://api.tiles.mapbox.com/mapbox.js/v0.6.4/mapbox.js'></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v0.6.4/mapbox.css' rel='stylesheet' />
<title>VTIrene recap</title>
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
# First, clear out any old mapnik or node.js installs that might conflict
sudo apt-get purge libmapnik libmapnik-dev mapnik-utils nodejs
# Also clear out any old ppa's that might conflict
sudo rm /etc/apt/sources.list.d/*mapnik*
sudo rm /etc/apt/sources.list.d/*developmentseed*
sudo rm /etc/apt/sources.list.d/*chris-lea*
# add new ppa's
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js
@Rub21
Rub21 / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Rub21
Rub21 / scale.md
Last active August 29, 2015 14:15 — forked from ian29/scale.md

scale, and selecting specific zoom levels

Mapnik is very smart about converting map scale to zoom level. As a secret/power user feature, Mapnik exposes a !scale_denominator! variable that changes according to the zoom level and + latitude of the vector tile being rendered. Read about the Mapnik's !scale_denominator! variable here.

With some postgres magic, the !scale_denominator lets us control which features appear and disappear, within a layer.

Concretely this is a two-part process. First you will need to load the following z() function into your PostGIS database:

CREATE OR REPLACE FUNCTION public.z(scaledenominator numeric)

Getting Started with NPM (as a developer)- Segir si funciona

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser