Skip to content

Instantly share code, notes, and snippets.

View dersteppenwolf's full-sized avatar
🏠
Working from home

Juan Carlos Méndez dersteppenwolf

🏠
Working from home
View GitHub Profile
@hallahan
hallahan / installation.md
Last active February 14, 2017 13:00
SpatialServer Installation Instructions

Preliminary Packages

Make sure you have done sudo apt-get update and sudo apt-get upgrade on your fresh install. This guide is geared toward Ubuntu 14.04 LTS (Trusty Tahr). Most of the guide will work for earlier versions of Ubuntu with some slight changes, but 14.04 is advised.

Enable the root user

sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/
@andrewxhill
andrewxhill / gameplan.md
Last active August 29, 2015 14:10
CartoDB Fiesta
@andrewxhill
andrewxhill / rivers.md
Last active April 28, 2017 17:29
Steps used to make map of California rivers
@andy-esch
andy-esch / cartodb.js-deep-dive.md
Last active August 29, 2015 14:10
CartoDB14 Outline for CartoDB.js

Introduction to the CartoDB interface

This page can always be found at: http://bit.ly/cdb-harvard

  • Tour of dashboard
  • Common data
  • Uploading data
  • Tour of table and map view
  • Publishing maps
  • Public profile
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin.git
import requests
import json
import random
import urllib
class MapInstance(object):
def __init__(self, definition, url, headers=None):
self.url = url
self.definition = definition
test_postgis=# select count(*) from sigpac_47_valladolid_parfe;
count
--------
342691
test_postgis=# select sum(st_memsize(the_geom_webmercator)) from sigpac_47_valladolid_parfe;
sum
-----------
254827296
(1 row)
@sanderpick
sanderpick / trigger.sql
Last active August 29, 2015 14:17
TRIGGER: clear old data on INSERT
CREATE OR REPLACE FUNCTION clearOld()
RETURNS TRIGGER
AS $$
BEGIN
DELETE FROM sf_muni_points WHERE created_at < now()-'1 day'::interval;
RETURN NEW;
END;
$$ language plpgsql;
CREATE TRIGGER clearOldOnInsert
@timgit
timgit / megaNumber.js
Last active January 15, 2020 08:35
Large number format filter for Angular written in ES6 that rounds to the specified decimal place (defaults to 1). 1 billion => 1B, 1,490,000 => 1.5M, 999,999 => 1M
angular.module('utilsModule').filter("megaNumber", () => {
return (number, fractionSize) => {
if(number === null) return null;
if(number === 0) return "0";
if(!fractionSize || fractionSize < 0)
fractionSize = 1;
var abs = Math.abs(number);