Skip to content

Instantly share code, notes, and snippets.

View danheberden's full-sized avatar

Dan Heberden danheberden

View GitHub Profile
var cloud = '',
users = {};
$('.js-comment-container').each(function() {
var c = $(this),
author = c.find('.author .author a').text(),
body = c.find('.content-body').text(),
words = body.split(' ').length;
users[ author ] = users[ author ] || 1;
@danheberden
danheberden / gist:1038635
Created June 21, 2011 19:18 — forked from ralphholzmann/gist:1038554
Challenge Accepted.
getEl = (function (doc) {
var getElementsByClassName = (function () {
return doc.getElementsByClassName ?
function (selector) {
return doc.getElementsByClassName(selector.split('.').pop());
} : function (selector) {
var parts = selector.split("."),
@danheberden
danheberden / vendorPrefix.js
Created April 21, 2011 06:46 — forked from addyosmani/vendorPrefix.js
JS snippet for getting the current vendor prefix of a CSS(3) property
function getPrefix( prop ){
var vendorPrefixes = ['Moz','Webkit','Khtml','O','ms'],
style = document.createElement('div').style,
upper = prop.charAt(0).toUpperCase() + prop.slice(1),
pref, len = vendorPrefixes.length;
while( len-- ){
if((vendorPrefixes[len] + upper) in style){
pref = (vendorPrefixes[len]);
}
}
@danheberden
danheberden / gyazo.php
Created February 17, 2011 06:20 — forked from cowboy/gyazo.php
<?PHP
/*
* PHP upload for Gyazo - v1.2 - 02/16/2011
* http://benalman.com/news/2009/10/gyazo-on-your-own-server/
*
* Copyright (c) 2009 "Cowboy" Ben Alman
* Licensed under the MIT license
* http://benalman.com/about/license/
*/