Skip to content

Instantly share code, notes, and snippets.

@csessig86
csessig86 / gist:039505048b3964b597d7
Last active August 29, 2015 14:14
Reduce size of image
<script>$('#article-container #mediawell').css('max-width','400px');</script>
@csessig86
csessig86 / gist:0fdc973e4746d7fb9b32
Created February 19, 2015 16:30
Static image teaser for database link
<div class="left">
<h3><a href="http://thegazette.com/data/lottery-retail" target="_blank">Database: Iowa Lottery retailers with jackpot wins</a></h3>
<a href="http://thegazette.com/data/lottery-retail" target="_blank"><img style="width: 100%;" src="http://thegazette.com/Includes/data/projects/lottery-retail/ss.jpg" alt="" /></a>
<p class="embed-subhead">Click to see the lottery retailers won $1,000 or more between July 2013 and mid-November.</p>
</div>
@csessig86
csessig86 / gist:17ed0d1957cca71b34b6
Last active August 29, 2015 14:17
Free and reduce lunch: Iowa schools (2014-15)
District,Name,Enrollment,FreeLunch,ReducedLunch,FreeorReduced,FreeorReducedPrice,FreeOrReducedPercent
9,AGWSR,539,178,34,212,39.33,39.3
18,Adair-Casey,287,96,12,108,37.63,37.6
27,Adel DeSoto Minburn,1629,282,83,365,22.41,22.4
63,Akron Westfield,552,135,49,184,33.33,33.3
72,Albert City-Truesdale,99,36,17,53,53.54,53.5
81,Albia,1167,366,74,440,37.7,37.7
99,Alburnett,622,77,20,97,15.59,15.6
108,Alden,228,56,22,78,34.21,34.2
126,Algona,1358,331,129,460,33.87,33.9
<div id="table-shootings" class="table-container left">
<h3>Shooting arrests: 2014</h3>
<table class="table table-striped">
<thead>
<tr><th class="Date-cell">Date</th><th class="Address-cell">Address</th><th class="Name(s)-cell">Name(s)</th></tr>
</thead>
<tbody>
<tr class="firstRow">
<td class="Date">1/3/2014</td>
<td class="Address">5620 Johnson Ave</td>
<script>$('#mediawell').addClass('fullWidth');</script>
@csessig86
csessig86 / gist:f1596f10fb61dc8f9c3b
Last active August 29, 2015 14:17
Embed asset as default
<script>$('#mediawell-list li').each(function() {if ( $(this).attr('id') === 'tab-embed-one' ) {$(this).prependTo(this.parentNode);}});</script>
@csessig86
csessig86 / ia_free_reduced.csv
Created March 28, 2015 20:49
SVG drawing, D3 data load
District Name Enrollment FreeLunch ReducedLunch FreeorReduced FreeorReducedPrice
9 AGWSR 539 178 34 212 39.33
18 Adair-Casey 287 96 12 108 37.63
27 Adel DeSoto Minburn 1629 282 83 365 22.41
63 Akron Westfield 552 135 49 184 33.33
72 Albert City-Truesdale 99 36 17 53 53.54
81 Albia 1167 366 74 440 37.7
99 Alburnett 622 77 20 97 15.59
108 Alden 228 56 22 78 34.21
126 Algona 1358 331 129 460 33.87
// Create an svg
svg = d3.select("svg")
.attr("width", width + margin.right + margin.left)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + (margin.left - line_width) + "," + margin.top + ")");
@csessig86
csessig86 / ia_free_reduced_50_higher.csv
Created April 4, 2015 19:39
Bar chart: Free and reduced lunch in IA
District Name Enrollment FreeLunch ReducedLunch FreeorReduced FreeorReducedPrice FreeOrReducedPercent
5310 Postville 656 654 0 654 99.7 99.7
5184 Perry 1746 1104 222 1326 75.95 75.9
6219 Storm Lake 2306 1453 253 1706 73.98 74
6516 Twin Rivers 50 30 7 37 74 74
1368 Columbus 739 487 59 546 73.88 73.9
1737 Des Moines Independent 31356 19796 3163 22959 73.22 73.2
1701 Denison 2126 1273 255 1528 71.87 71.9
4104 Marshalltown 4852 2932 456 3388 69.83 69.8
6795 Waterloo 10662 6498 914 7412 69.52 69.5
@csessig86
csessig86 / ia_free_reduced_50_higher.csv
Last active August 29, 2015 14:19
Cleaned bar chart: Free and reduced lunch in IA
District Name Enrollment FreeLunch ReducedLunch FreeorReduced Price Percent
72 Albert City-Truesdale 99 36 17 53 53.54 53.5
135 Allamakee 1116 329 237 566 50.72 50.7
387 Atlantic 1499 600 155 755 50.37 50.4
594 Belmond-Klemme 716 334 37 371 51.82 51.8
882 Burlington 4001 2225 217 2442 61.03 61
916 CAL 220 117 21 138 62.73 62.7
977 Cardinal 627 306 56 362 57.74 57.7
1053 Cedar Rapids 15884 6894 1055 7949 50.04 50
1093 Central Decatur 698 339 109 448 64.18 64.2