Skip to content

Instantly share code, notes, and snippets.

View keithcollins's full-sized avatar

Keith Collins keithcollins

View GitHub Profile
@keithcollins
keithcollins / index.html
Created May 29, 2014 17:23
Interval progress bar
<style type="text/css" media="screen">
#play-progress {
width: 910px;
margin-bottom: 20px;
background-color: #28AADE;
height: 36px;
position: relative;
border-radius: 20px;
}
@keithcollins
keithcollins / gist:5572850
Last active December 17, 2015 07:29
Twitter and Facebook stats via AJAX/jQuery
# the permalink var is an array created before this. it takes the permalink from each WordPress post as they load.
function commaSeparateNumber(val){
while (/(\d+)(\d{3})/.test(val.toString())){
val = val.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
}
return val;
}
$(document).ready(function () {
var fb_likes = 0,
@keithcollins
keithcollins / gist:5572897
Last active December 17, 2015 07:29
A couple of CSS classes from Project Wordsworth
.story-box {
z-index: auto;
box-shadow: rgb(153, 153, 153) 0px 0px 0px 0px;
-webkit-transform: matrix(1, 0, 0, 1, 0, 0);
-moz-transform: matrix(1, 0, 0, 1, 0, 0);
cursor: pointer;
margin-bottom:10px;
padding: 5px;
display: block;
min-height: 350px;
@keithcollins
keithcollins / gist:5572890
Last active December 17, 2015 07:29
Simple rollover effects with jQuery
$('.story-box').on('mouseenter', function(){
$(this).addClass('story-box-up').find('.tcontents_title a').css('color', '#A80405');
}).on('mouseleave', function(){
$(this).removeClass('story-box-up').find('.tcontents_title a').css('color', 'black');
}).on('click mousedown', function(){
var permalink = $(this).find('.tcontents_title a').attr('href');
window.location = permalink;
});
@keithcollins
keithcollins / formProcess
Created June 15, 2013 17:14
First, we take the ID and action of the form being called. Next, we post the serialized form data to the handler specified in the form's action attribute. On success, the handler should output a message to indicate all is well, or an error indicating otherwise. Remember that div at the bottom of the registration form? This is where the returned …
$('.ajaxForm').on('submit', function(e) {
var formId = $(this).attr('id'),
doAction = $(this).attr('action');
$.post(doAction, $(this).serialize(),
function(data) {
$('#'+formId+'_result').html(data);
});
e.preventDefault();
});
var fs = require('fs');
var d3 = require('d3');
var Twit = require('twit')
var T = new Twit({
consumer_key: '',
consumer_secret: '',
access_token: '',
access_token_secret: ''
});
## At the get-together of the AGC developers celebrating the 40th anniversary
## of the first moonwalk, Don Eyles (one of the authors of this routine along
## with Peter Adler) has related to us a little interesting history behind the
## naming of the routine.
##
## It traces back to 1965 and the Los Angeles riots, and was inspired
## by disc jockey extraordinaire and radio station owner Magnificent Montague.
## Magnificent Montague used the phrase "Burn, baby! BURN!" when spinning the
## hottest new records. Magnificent Montague was the charismatic voice of
## soul music in Chicago, New York, and Los Angeles from the mid-1950s to
CAF CODE500 # ASTRONAUT: PLEASE CRANK THE
TC BANKCALL # SILLY THING AROUND
CADR GOPERF1
TCF GOTOP00H # TERMINATE
TCF P63SPOT3 # PROCEED SEE IF HE'S LYING
P63SPOT4 TC BANKCALL # ENTER INITIALIZE LANDING RADAR
CADR SETPOS1
# THE FOLLOWING QUOTATION IS PROVIDED THROUGH THE COURTESY OF THE AUTHORS.
#
# "IT WILL BE PROVED TO THY FACE THAT THOU HAST MEN ABOUT THEE THAT
# USUALLY TALK OF A NOUN AND A VERB, AND SUCH ABOMINABLE WORDS AS NO
# CHRISTIAN EAR CAN ENDURE TO HEAR."
# HENRY 6, ACT 2, SCENE 4
TC BANKCALL # TEMPORARY, I HOPE HOPE HOPE
CADR STOPRATE # TEMPORARY, I HOPE HOPE HOPE