Skip to content

Instantly share code, notes, and snippets.

:octocat:
Live and in stereo

Danny Garcia buzzedword

:octocat:
Live and in stereo
Block or report user

Report or block buzzedword

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@buzzedword
buzzedword / gist:627318
Created Oct 14, 2010
ASP.NET Friendly Show/Hide in jQuery
View gist:627318
jQuery.fn.aspHide = function() {
var elem = $(this[0]);
elem.data('height', elem.height());
elem.height('0');
elem.css('visibility', 'hidden');
};
jQuery.fn.aspShow = function() {
var elem = $(this[0]);
elem.height(elem.data('height'));
View aspHide
jQuery.fn.innerWrap = function() {
var a, args = arguments;
return this.each(function() {
if (!a)
a = jQuery.clean(args, this.ownerDocument);
// Clone the structure that we're using to wrap
var b = a[0].cloneNode(true),
c = b;
// Find the deepest point in the wrap structure
while ( b.firstChild )
View gist:633066
//Gallery Thumbs
    $("div.thumbs > a").click(function (e){
        $("div.thumbs > a").removeClass("active"); //Remove any "active" class
$(this).addClass("active"); //Add "active" class to selected tab
$(".gallery_content").hide(); //Hide all tab content
        
var activeTab = $(this).attr("href"); //Find the rel attribute value to identify the active tab + content
$(activeTab).fadeIn(); //Fade in the active content
setTimeout(function () {          
Cufon.refresh();          
View gist:651726
var fizzbang = function(){
return {
foo : function(){
alert('This is a method');
},
bar : function(){
alert('This is also a method');
}
};
}();
View readystate.js
var checkReady = setInterval(function(){
if (document.readyState == "complete") {
document.write('Document ready');
clearInterval(checkReady);
}
}, 1);
@buzzedword
buzzedword / jQueryLint.js
Created Jan 10, 2011
jQuery Lint bookmarklet
View jQueryLint.js
javascript:(function(){(function(){var el=document.createElement('div'),b=document.getElementsByTagName('body')[0];otherlib=false,msg='';el.style.position='fixed';el.style.height='32px';el.style.width='220px';el.style.marginLeft='-110px';el.style.top='0';el.style.left='50%';el.style.padding='5px 10px 5px 10px';el.style.zIndex=1001;el.style.fontSize='12px';el.style.color='#222';el.style.backgroundColor='#f99';function getLint(url){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;}};head.appendChild(script);}function getScript(url,success){var script=document.createElement('script');script.src=url;var head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=
@buzzedword
buzzedword / AsyncBlocks.js
Created Jan 11, 2011
Simple async building blocks for threading
View AsyncBlocks.js
var queueExecutionInterval = 200,
debug = function (call) {
if ("console" in window) {
console.log.apply(call);
}
},
QUEUE = [],
SECONDARY = [],
functionContainer, primaryThread = setInterval(function () { // QUEUE.push( function ) to register item for queue processing.
if (QUEUE.length > 1) {
View JSON merge.js
var obj1index = obj1.length;
for (var obj2index in obj2){
obj1[obj1index] = obj2[obj2index];
obj1index++;
}
@buzzedword
buzzedword / protobull.js
Created Mar 18, 2011
Recommended alternative to mutable __proto__ from mozilla
View protobull.js
Object.create2 = function(a, b) {
var res = Object.create(a);
for (var x in b) { if (b.hasOwnProperty(x)) res[x] = b[x]; }
return res;
}
var o = Object.create2(foo, { f:0, g:1, ... });
@buzzedword
buzzedword / js.rb
Created Mar 21, 2011
Javascript routing file using CoffeeScript in Monk
View js.rb
class Main
get "/js/:application.js" do
content_type "text/javascript", :charset => "UTF-8"
CoffeeScript.compile File.read("app/views/js/#{params[:application]}.coffee")
end
end
You can’t perform that action at this time.