Skip to content

Instantly share code, notes, and snippets.

View scottgonzalez's full-sized avatar

Scott González scottgonzalez

View GitHub Profile
var spawn = require( "child_process" ).spawn;
var path = "/Users/scottgonzalez/Projects/jquery-release";
var committish = "master";
function getLog( callback ) {
var stdout = "";
var stderr = "";
var child = spawn( "git", [ "log", "--format=%s", committish ], { cwd: path } );
var hadError = false;
/*
* Web Forms 0.4.0 - jQuery plugin
*
* Copyright (c) 2007 - 2008 Scott Gonzalez
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
  • Go to RGB Color Now
    • Already implemented; just basic RGB functionality
  • Fade to RGB Color
    • Can be implemented; needs fading logic
  • Fade to HSB Color
    • Can be implemented; needs fading logic and HSB translation
  • Fade to Random RGB Color
    • Can be implemented; needs fading logic
  • Fade to Random HSB Color
  • Can be implemented; needs fading logic
@scottgonzalez
scottgonzalez / jquery-element.js
Created November 13, 2009 02:32
jQuery object normalization
function element(value, context) {
var ret = $([]); // $(context) ?
if (value.jquery) {
ret = value;
} else if (value == 'parent') {
ret = $(context).parent();
} else if (value == 'clone') {
ret = $(context).clone().removeAttr('id');
} else if (value == 'window') {
var http = require("http"),
querystring = require("querystring"),
sys = require("sys");
var channel = "http://chat.nodejitsu.com/chat",
speed = 5000,
spammers = 10;
for (var i = 0; i < spammers; i++ ) {
setTimeout(startSpamming, (speed / spammers) * i);
#!/usr/bin/env node
var sys = require("sys"),
fs = require("fs"),
chat = require('../lib/server'),
router = require("../lib/router");
// create chat server
var chatServer = chat.createServer();
chatServer.listen(8001);
var crypto = require('crypto');
["sha1", "md5", "sha256", "sha512", "ripemd160"].forEach(function(algo) {
exports[algo] = function(data, salt) {
return (typeof salt != 'undefined' ?
crypto.createHmac(algo, salt) :
crypto.createHash(algo)
).update(data).digest("hex");
};
});
var initSource = $.ui.autocomplete.prototype._initSource;
$.ui.autocomplete.prototype._initSource = function() {
if ( typeof this.options.source === "string" && this.options.cache ) {
var self = this,
cache = {};
this.source = function( request, response ) {
var term = request.term;
if ( cache[ term ] ) {
response( cache[ term ] );
$.widget( "ui.autocomplete", $.ui.autocomplete, {
_suggest: function( items ) {
var menu = this.menu.element,
width = menu.width(),
height = menu.height();
this._super( "_suggest", items );
var newWidth = menu.width(),
newHeight = menu.height();
menu.css({
width: width,
$.event.special.hijax = {
setup: function() {
$.event.add( this, "click.specialHijax", function( event, data ) {
if ( event.which !== 1 || event.metaKey || event.ctrlKey ) {
return;
}
event.type = "hijax";
event.liveFired = undefined;
return jQuery.event.trigger( event, data, event.target );