Skip to content

Instantly share code, notes, and snippets.

View hampelm's full-sized avatar

Matt Hampel hampelm

View GitHub Profile
{
created: "2013-09-18T00:33:06.839Z",
id: "e3155270-1ff9-11e3-baa3-f5f2bdb7f3ee",
survey: "8a340df0-87af-11e2-9485-c3fff44e7c8e",
type: "mobile",
parcels: [
],
questions: [
{
@hampelm
hampelm / gist:2c6e5190aa03e22e8eed
Last active August 29, 2015 14:18
Heroku Dyno Beta Email

Hi there,

We’ve created new dynos so you can choose the features and pricing that best fit your use case, from demo apps and hobby projects to production and super-scale apps.

As someone selected for the private beta, you have special early access to opt in and try these new dynos. We want your feedback!

Getting started is easy:

  • Select one of your apps in the dashboard, then click “Edit” in the Resources tab.
  • Select the dyno type you wish to use and click “Save”.
@hampelm
hampelm / gist:aa1a9243845878ef8711
Created March 28, 2015 20:24
Sample: get value of slider and run new SQL query
var sbsVal, farVal;
function changeSQL() {
// run new sql
cartodb({
sql: "Select score * " + sbsVal + "...moreSQL";
... etc
})
}
-- Join school scores
SELECT
pluto.the_geom_webmercator,
pluto.cartodb_id,
pluto.sbs_s,
sum(schools.grade_code) as score
FROM
nyc_pluto_14v1_compressed_customized as pluto
JOIN
schools
html,
body,
#map,
#tools,
#data {
height: 100vh;
}
#map,
#tools,
@hampelm
hampelm / gist:128feb0f2994e2ec824e
Last active August 29, 2015 14:17
LocalData description for CodeforAmerica
{% if include.context == "app-page" %}
<div class="heading">
<h2>LocalData</h2>
</div>
<div class="layout-minor">
<img class="isolate" src="{{ include.base }}/media/images/apps/localdata.jpg" />
<h3 class="text-prominent">Overview</h3>
@hampelm
hampelm / gist:349d8c12480396d75fd3
Created March 12, 2015 18:45
Add pre-1990 data
$.ajax({
url: 'https://localdata.cartodb.com/api/v1/map',
type: 'GET',
dataType: 'jsonp',
data: {
config: JSON.stringify({
version: '1.0.1',
layers:[{
type:'cartodb',
options:{
//MAP SCRIPT
var mapt9b;
var type = 1,loaded=1;
var sub,s92,s94,s96,s98,s00,s02,s04,s06,s08,s10,s12;
var year_ = 1990;
(function($) {
function formatNumber (num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,");
}
$(function() {
@hampelm
hampelm / gist:e0757871331da243433e
Last active August 29, 2015 14:16
LU5_Greenfield_1992_2012 layer-color mappings
92
http://gis.mtc.ca.gov/mtc/rest/services/VitalSigns/LU5_Greenfield_1992_2012/FeatureServer/10
http://localdata.cartodb.com/api/v2/viz/68feb116-c84a-11e4-9365-0e4fddd5de28/viz.json
#4B2D73
94
http://gis.mtc.ca.gov/mtc/rest/services/VitalSigns/LU5_Greenfield_1992_2012/FeatureServer/9
http://localdata.cartodb.com/api/v2/viz/58e58fde-c84a-11e4-819d-0e0c41326911/viz.json
#2D882D
@hampelm
hampelm / gist:c803aad16bc0ceae8707
Last active August 29, 2015 14:16
Greenfield map script
//MAP SCRIPT
var mapt9b;
var type = 1,loaded=1;
var sub,s92,s94,s96,s98,s00,s02,s04,s06,s08,s10,s12;
var year_ = 1990;
(function($) {
function formatNumber (num) {
return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,")
}
$(function() {