Skip to content

Instantly share code, notes, and snippets.

View bigeasy's full-sized avatar

Alan Gutierrez bigeasy

  • New Orleans, LA
View GitHub Profile
@bigeasy
bigeasy / hash_submit.js
Created March 31, 2009 14:19
jQuery Plugin to Convert text/plain Name Value Key Pairs to a Hash
(function ($) {
// Keep a copy of the old get.
var jQuery_get = jQuery.get;
jQuery.extend({
get: function( url, data, callback, type, options ) {
// Shift arguments if data argument was omitted.
if ( jQuery.isFunction( data ) ) {
package com.goodworkalan.prattle.model;
import java.io.Serializable;
public class Person implements Serializable
{
private static final long serialVersionUID = 1L;
private String firstName;
class ThingsController < ApplicationController
# call-seq:
# GET http://domain.tld/things
#
def index
@things = Thing.all
end
# call-seq:
# GET http://domain.tld/things/:id
@bigeasy
bigeasy / fckeditor.rb
Created August 24, 2009 18:28
How to use Scott Rutherford's FCKEditor Plugin with Adva CMS.
ActionView::Helpers::AssetTagHelper.register_javascript_expansion :admin => %w[fckeditor/fckeditor.js]
package com.goodworkalan.snap;
@Command
public class Welcome implements Commandable {
public String greeting;
@Argument
public void addGreeting(String greeting) {
this.greeting = greeting;
}
package com.goodworkalan.snap;
@Command
public class Welcome implements Commandable {
public String greeting;
@Argument
public void addGreeting(String greeting) {
this.greeting = greeting;
}
package com.goodworkalan.spawn;
import static org.testng.Assert.assertEquals;
import java.io.File;
import org.testng.annotations.Test;
public class SpawnTest {
@Test
[alan@development.rails ~]$ sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "en_US",
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
function createCar() {
var rpms = 0;
function rev () {
rpms++;
}
return { rev: rev
};
}
coffee> SaxPushParser = require("libxmljs").SaxPushParser
[Function]
coffee> new SaxPushParser
TypeError: Bad argument: function required
at Object.<anonymous> (eval at <anonymous> (/opt/lib/node/.npm/coffee-script/0.9.3/package/lib/coffee-script.js:42:25))
at Object.run (/opt/lib/node/.npm/coffee-script/0.9.3/package/lib/coffee-script.js:42:12)
at Interface.<anonymous> (/opt/lib/node/.npm/coffee-script/0.9.3/package/lib/repl.js:15:26)
at Interface.emit (events:26:26)
at Interface._ttyWrite (readline:281:12)
at Interface.write (readline:123:27)