Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / top-paid-doctors.html
Created July 1, 2016 20:36
Top paid doctors embed
<div class="left">
<h3><a href="http://thegazette.com/data/top-paid-doctors" target="_blank">Highest paid doctors in Iowa</a></h3>
<a href="http://thegazette.com/data/top-paid-doctors" target="_blank"><img style="width: 100%;" src="http://thegazette.com/Includes/data/projects/top-paid-doctors/ss.jpg" alt=""></a>
<p class="embed-subhead">Click to find out if your doctor is among the highest paid doctors in Iowa.</p>
</div>
@csessig86
csessig86 / hoopla-quiz-1.haml
Last active July 5, 2016 22:35
Hoopla quiz module 1
%ul.quiz-submit{:data => {:topic => "Category"}}
-@related_events.each do |e|
= render "events/event_result", event: e
%li.square.module.survey
%p
%strong Which type of event category do you prefer?
.btn-container
%button.answer-btn.btn-large.link
=fa_icon('compass')
%span.text
@csessig86
csessig86 / date-picker.js
Last active August 1, 2016 16:39
Initialize Materialize date picker
var $input_one = $('#input-calendar-1 .datepicker').pickadate({
'options_go_here': 'text'
});
var picker_one = $input_one.pickadate('picker');
@csessig86
csessig86 / time-splitter.rb
Created August 1, 2016 16:58
Time splitter init with current time zone
extend TimeSplitter::Accessors
split_accessor :start_time, default: ->{Time.zone.parse('00:00:00')}
split_accessor :end_time, default: ->{Time.zone.parse('00:00:00')}
@csessig86
csessig86 / start-end-time.rb
Created August 2, 2016 21:30
If, else start time
if params[:event][:start_time_time].to_time >= params[:event][:end_time_time].to_time
@event = Event.new(event_params)
@event.errors[:base] << "The end time must be after the start time."
else
@csessig86
csessig86 / position-relative.css
Created August 5, 2016 16:37
Container relative
body div.container {
//This is causing some weird scrolling on certain pages. Let's only apply it where we absolutely need it.
//min-height:100%;
position:relative;
}