Skip to content

Instantly share code, notes, and snippets.

:octocat:
Live and in stereo

Danny Garcia buzzedword

:octocat:
Live and in stereo
View GitHub Profile
@buzzedword
buzzedword / comments.json
Created Mar 22, 2011
Proof of concept for encapsulating comments in a JSON string, then cleaning it out on the client side.
View comments.json
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 Mar 23, 2011
Zendesk REST Wrapper
View zendesk.cs
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 Apr 1, 2011
IIFE with named anonymous parameters
View jquery.1.5.1.min.js
/*!
* 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
Globalized storage for jQuery using a document fragment instead of $(element).data();
View jQuery.storage.cache.js
/*
* 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
Grooveshark Chrome Extension
View gs.js
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 Jun 8, 2011
Console tic tac toe.
View console.js
var grid;
function Grid() {
var grid, quadrant, dash, stilt, breaks;
dash = '-------------------------';
stilt = '| | | |';
breaks = '\n\r';
quadrant = {
@buzzedword
buzzedword / loadjs.js
Created Jun 15, 2011 — forked from qwertypants/loadjs.js
Super tiny JS loader
View loadjs.js
// {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;
View fuck_those_spammers.js
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 Jul 1, 2011
jQuery.browser extension to include mobile safari.
View jquery.IOS.js
jQuery.extend(jQuery.browser,
{
IOS : navigator.userAgent.toLowerCase().match(/iP(hone|ad|od)/i)
}
);
// ...
if ($.browser.IOS) {
// Do something IOS-y
View plus.google.com.js
(function($){
var ns = {};
ns.snoop = function(defaultStreamID){
if (window.location.pathname == "/"){
window.location = "https://plus.google.com/stream/cicles/" + defaultStreamID;
} else {
//
}
};
$(window).ready(function(){
You can’t perform that action at this time.