Skip to content

Instantly share code, notes, and snippets.

asmedrano / gist:2466271
Created Apr 22, 2012
New Twitter Bootstrap row every Nth item.
View gist:2466271
{%for item in items%}
{% if forloop.first or forloop.counter0|divisibleby:3 %}
<div class = "row">
{# We need to add a new Bootstrap row every after every third item item#}
<div class = "span4">
<h3><a href ="">{{title}}</a></h3>
<span>Posted on {{created_on}} </span>
asmedrano /
Created Apr 26, 2012
ACS2010 Census Summary Levels as a Dict
Summary Level Definitions
Defined as:
SUMLEV: (Geographies, Hierarchy(when avail))
'010':('United States', 'United States'),
View gist:2895558
// a simple addition function
function add_these(num1, num2){
$result = $num1 + $num2;
return $result;
asmedrano / index.html
Created Oct 3, 2012 — forked from enjalot/index.html
Simple Pie Chart example with D3.js
View index.html
<!DOCTYPE html>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Testing Pie Chart</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<style type="text/css">
asmedrano / gist:3853932
Created Oct 8, 2012
Setting up a WebView for Ubuntu App Dev
View gist:3853932
import gettext
import os
from gettext import gettext as _
from gi.repository import Gtk, WebKit # pylint: disable=E0611
import logging
logger = logging.getLogger('html5test')
from html5test_lib import Window
View gist:3947679
class ScruffySpider(BaseSpider):
name = "scruffy"
allowed_domains = ['']
start_urls = [
domain_pattern = re.compile('constantcontact\.com')
mailto_pattern = re.compile('mailto\:')
asmedrano /
Created Nov 16, 2012 — forked from forkandwait/
Reworked script for loading tiger data
declare -A FIPS
declare -A STNAME
FIPS[AK]=02; STNAME[AK]=Alaska
FIPS[AL]=01; STNAME[AL]=Alabama
FIPS[AR]=05; STNAME[AR]=Arkansas
FIPS[AS]=60; STNAME[AS]=American Samoa
FIPS[AZ]=04; STNAME[AZ]=Arizona
FIPS[CA]=06; STNAME[CA]=California
FIPS[CO]=08; STNAME[CO]=Colorado
FIPS[CT]=09; STNAME[CT]=Connecticut
asmedrano / gist:4627261
Last active Dec 11, 2015
Simple script to download a list of files with wget
View gist:4627261
Give a list like so...
Lets call it list.txt
asmedrano / gist:4708675
Created Feb 4, 2013
Get the location of the bash script you are running. Great for making alias..ssss
View gist:4708675
SCRIPTPATH=$(cd "$(dirname "$0")"; pwd)
asmedrano / gist:6065275
Created Jul 23, 2013
Installing postgis on ubuntu 13.04
View gist:6065275
sudo add-apt-repository ppa:ubuntugis
sudo apt-get update
sudo apt-get install postgis postgresql-9.1-postgis
# youll need this /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
# and this /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
# now create a spatially enabled template db
The first step in creating a PostGIS database is to create a simple PostgreSQL database.