Skip to content

Instantly share code, notes, and snippets.

View keithcollins's full-sized avatar

Keith Collins keithcollins

View GitHub Profile
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: ''
});
@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 / 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();
});
@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 / 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,