Skip to content

Instantly share code, notes, and snippets.

View buzzedword's full-sized avatar
:octocat:
Live and in stereo

Danny Garcia buzzedword

:octocat:
Live and in stereo
View GitHub Profile
@buzzedword
buzzedword / comments.json
Created March 22, 2011 17:51
Proof of concept for encapsulating comments in a JSON string, then cleaning it out on the client side.
jsonp123(
{
"//" : "Here comes the callback",
"callback": {
"//": "This has the first item",
"item": {
"title": "Databases",
"content": {
"item": {
"//": "Here's where the content is",
@buzzedword
buzzedword / zendesk.cs
Created March 23, 2011 00:04
Zendesk REST Wrapper
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
namespace MyApplication
{
/// <summary>
@buzzedword
buzzedword / jquery.1.5.1.min.js
Created April 1, 2011 16:14
IIFE with named anonymous parameters
/*!
* jQuery JavaScript Library v1.5.1
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
@buzzedword
buzzedword / jQuery.storage.cache.js
Created May 20, 2011 17:21
Globalized storage for jQuery using a document fragment instead of $(element).data();
/*
* Notes: Optimized for "set" operations
* Performance test URL: http://jsperf.com/global-storage-vs-jquery
*/
(function($, unknown) {
// Usage: Instead of $(elem).data('key'), you use $.storage.get('key') for retrieval.
// Usage: Instead of $(elem).data('key', 'value'), you use $.storage.set('key', 'value') for set.
$.storage = {
get: function(key) {
if (typeof $.storage.db == 'undefined') {
@buzzedword
buzzedword / gs.js
Created May 24, 2011 22:40
Grooveshark Chrome Extension
chrome.extension.onRequest.addListener(
function(request, sender, sendResponse) {
switch (request.message.action){
case "addSong" :
Grooveshark.addSongsByID(request.message.ID, true);
break;
case "getSong" :
var song = GrooveShark.getCurrentSongStatus().song;
sendResponse({"songTitle": song});
break;
@buzzedword
buzzedword / console.js
Created June 8, 2011 22:33
Console tic tac toe.
var grid;
function Grid() {
var grid, quadrant, dash, stilt, breaks;
dash = '-------------------------';
stilt = '| | | |';
breaks = '\n\r';
quadrant = {
@buzzedword
buzzedword / loadjs.js
Created June 15, 2011 17:31 — forked from qwertypants/loadjs.js
Super tiny JS loader
// {String} f File name
// {Boolean} c Condition
// {undefined} [l,j,s] Shortcut for var.
var loadjs = function(f,c,l,j,s,a) {
a = ((typeof f == 'object')? f : []);
f = ((typeof f == 'undefined') ? '' :
((typeof f == 'object') ?
((typeof f[0] !== 'undefined')? f[0] : '')
: f));
l = f.length;
jQuery.getScript('http://code.jquery.com/jquery-latest.min.js', function(){
$('iframe#appFrame').contents().find('button[name|="No, thanks"]').click();
});
@buzzedword
buzzedword / jquery.IOS.js
Created July 1, 2011 03:52
jQuery.browser extension to include mobile safari.
jQuery.extend(jQuery.browser,
{
IOS : navigator.userAgent.toLowerCase().match(/iP(hone|ad|od)/i)
}
);
// ...
if ($.browser.IOS) {
// Do something IOS-y
@buzzedword
buzzedword / plus.google.com.js
Created July 11, 2011 16:04
Default Circles
(function($){
var ns = {};
ns.snoop = function(defaultStreamID){
if (window.location.pathname == "/"){
window.location = "https://plus.google.com/stream/cicles/" + defaultStreamID;
} else {
//
}
};
$(window).ready(function(){