Skip to content

Instantly share code, notes, and snippets.

@necolas
necolas / stylesheet-injector.js
Created November 5, 2010 09:49
Create and append style sheets to document <head> using JavaScript
(function() {
var css = [
'/css/default.css',
'/css/section.css',
'/css/custom.css'
],
i = 0,
link = document.createElement('link'),
head = document.getElementsByTagName('head')[0],
tmp;
@necolas
necolas / functions.php
Created June 17, 2010 11:23
Wordpress custom retweet and save buttons
// Adds custom retweet and delicious buttons to Wordpress template
// Uses bit.ly, delicious, backtype, tweetmeme, and topsy APIs
// Adapted from Backtype Tweetcount plugin
// Nicolas Gallagher / @necolas
function tweet_save($url) {
global $post;
$url = '';
$btype_cnt = null;
$topsy_cnt = null;