Skip to content

Instantly share code, notes, and snippets.

<div class="blockquote">
<p class="quote">This is where a block quote will go. Block quotes are super exciting. You should probably be really pumped to have one on your page.</p>
<p class="attribution">- Frank Johnson</p>
<p class="detail">He is a super cool dude so you should listen to him</p>
<div class="blockquote-clear" style="clear: both;"></div>
</div>
overflow: scroll;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
@csessig86
csessig86 / csv_binify.sh
Last active January 2, 2016 09:59
How I turned a csv into a binified shapefile and then a JSON file. Uses ogr2ogr (http://www.gdal.org/ogr2ogr.html) and binify (https://github.com/kevinschaul/binify)
# We start with a CSV called "crime_master_wloo_violent.csv" that has violent crime reports in Waterloo.
# Included in csv are columns for latitude ("lat") and longitude ("long"):
https://github.com/csessig86/crime_map2013/blob/master/csv/crime_master_wloo_violent.csv
# Command to turn CSV into DBF with the same name
ogr2ogr -f "ESRI Shapefile" crime_master_wloo_violent.dbf crime_master_wloo_violent.csv
# Create a file called "crime_master_wloo_violent.vrt"
# Change "SrcLayer" to the name of the source
# Change OGRVRTLayer name to "wloo_violent"
@csessig86
csessig86 / Refresh page.html
Created November 5, 2013 23:33
This meta tag refreshes pages automatically. Content is set to seconds.
<META HTTP-EQUIV="refresh" CONTENT="15">
@csessig86
csessig86 / Bootstrap bar charts.css
Created November 5, 2013 23:13
Bar charts with Bootstrap. As used with election 2013 website
<table class='vote-results-table'>
<tr>
<td >
<div class='vote-results-header'>Results</div>
</td>
</tr>
{{#each candidates}}
<tr>
<td width='250px'><strong>{{candidate}}</strong>: {{votes}} votes</td>
</tr>
@csessig86
csessig86 / Courier header.css
Created November 5, 2013 23:11
Courier header for news apps outside CMS
<!-- Header -->
<div id="header-container" class="header-footer">
<h4><a href="#WaterlooCI" data-ajax="false">Election 2013</a></h4>
<a href="http://wcfcourier.com/">
<img id="courier-logo" src="images/WCFCourier_LOGO_BW_300px.png" />
</a>
</div>
@csessig86
csessig86 / Universal styles.css
Created November 5, 2013 23:10
Universal styles for news apps
/***** Universal styles *****/
html, body {
padding: 0px;
margin: 0px;
padding-right:1px;;
}
body {
font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
font-size: 13px;
@csessig86
csessig86 / Add commas.js
Created November 5, 2013 23:08
Function that adds commas to numbers 1,000 or greater
function numberFormat(nStr){
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1))
x1 = x1.replace(rgx, '$1' + ',' + '$2');
return x1 + x2;
}
@csessig86
csessig86 / jQuery mobile: Working links.html
Created November 5, 2013 23:07
Add this tag to get links to work properly with jQuery mobile
@csessig86
csessig86 / jQuery mobile: Remove loading text.js
Created November 5, 2013 23:06
Remove the word 'loading' from the bottom of jQuery mobile apps
$.mobile.loadingMessage = false;