Skip to content

Instantly share code, notes, and snippets.

@csessig86
csessig86 / social-share.js
Created June 8, 2016 14:24
Social sharing on The Gazette
// Set social buttons
function socialShare(network) {
var winWidth = 520;
var winHeight = 350;
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
var url = encodeURIComponent(window.location.href);
var title = $('#body-content h1').text();
if (title === "") {
@csessig86
csessig86 / ga-maps.js
Created June 7, 2016 19:48
HO GA maps
var map;
var geocoder;
Event.observe(window, 'load', codeAddress);
function initialize(latlng) {
latlng = new google.maps.LatLng(41.6591, -91.5319);
var myOptions = {
zoom: 15,
center: latlng,
@csessig86
csessig86 / racing-rankings-table.html
Last active May 31, 2016 18:22
Racing rankings table
<table style="width: 100%;">
<thead>
<tr class="hide-700-important">
<th class="Rank">RANK</th>
<th class="Trending">+/-</th>
<th class="Name"h>NAME</th>
<th class="Wins">CLASS</th>
<th class="Thoughts">THOUGHTS</th>
</tr>
</thead>
@csessig86
csessig86 / racing-table.html
Created April 27, 2016 21:59
Racing table
<tr style="background-color: lightgray;">
<td class="Rank">1</td>
<td class="Trending">+1</td>
<td class="Name">Nathan Ballard</td>
<td class="Wins"><span>Hobby Stock/</span><br><span>Sportsmen</span></td>
<td class="Thoughts">Here's the deal: Once again, I couldn't decide among the top three (also Driver of the Year finalists) so I went with wins this season, and Ballard is tops with 27. He's had by far the best year of his career with two (potentially) track titles in his Hobby Stock, and won five races in Sportsmen at Hawkeye Downs. He's been the best Hobby Stock in the area all season - and it's not close.</td>
</tr>
@csessig86
csessig86 / two-ajax-calls-2.js
Created April 21, 2016 16:53
Making two AJAX calls
// Holds data for each AJAX call
var global_data = {};
var global_data_two = {};
// Do the merge of the data here
function mergeData() {
console.log('merge data here');
}
@csessig86
csessig86 / two-ajax-calls-1.js
Created April 21, 2016 16:52
Making two AJAX calls
var global_data = {};
$.ajax({
type: "GET",
dataType: "json",
url: 'https://datagetter.herokuapp.com/arrests.json',
success: function(data){
global_data = data;
},
complete: function() {
@csessig86
csessig86 / two-ajax-calls-3.js
Last active April 21, 2016 16:54
Making two AJAX calls
// Holds data for each AJAX call
var global_data = {};
var global_data_two = {};
// Put data on Leaflet map
function leafletMap() {
console.log('Leaflet map creation here');
}
@csessig86
csessig86 / medicaid-explained.html
Created April 1, 2016 15:37
Medicaid explained embed
<div class="left">
<h3><a href="http://www.thegazette.com/data/medicaid-explained" target="_blank">Confused by how the new Medicaid system works?</a></h3>
<a href="http://www.thegazette.com/data/medicaid-explained" target="_blank"><img style="width: 100%;" src="http://www.thegazette.com/Includes/data/projects/medicaid-explained/img/chapter-2-full.gif" alt="" /></a>
<p class="embed-subhead">We're here to help. Click the image above to check out an interactive explanation of Iowa's new Medicaid managed care system.</p>
</div>
@csessig86
csessig86 / index.html
Last active March 9, 2016 15:45
Iowa basketball stats: 2016
<div class="chart-container center">
<h3>Adjusted tempo</h3>
<div class="lazyload"><!--
<div class="iframe-responsive-container" data-height="320px" data-600-height="250px">
<iframe frameborder="0" src="http://files.gazlab.com/content-host/c3charts/projects/ia-basketball-stats-2016/index.html#chart/adjustedtempo" width="100%"></iframe>
</div>
--></div>
<p>Download the data <a href="https://docs.google.com/spreadsheets/d/1CXSNt2f_oEcNUePR7ZwwCN6_R0AYbMVNC3Ue85_FFs8/edit#gid=0" target="_blank"><strong>here</strong></a></p>
</div>
@csessig86
csessig86 / index.html
Last active May 11, 2016 16:14
D3: Split icons into columns
<htmL>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
<script src="https://code.jquery.com/jquery-1.12.1.min.js" charset="utf-8"></script>
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<style>
#svg-table, #svg-container {