Skip to content

Instantly share code, notes, and snippets.

View macournoyer's full-sized avatar

Marc-André Cournoyer macournoyer

View GitHub Profile
# Montreal Against Rails code
# Written by macournoyer, Carl Mercier and Francois Beausoleil
## Framework code
class App
def call(env)
#im doing good
@request = Rack::Request.new(env)
@response = Rack::Response.new
#!/usr/bin/env ruby
# Lil' script to fix or implement Fogbugz tickets from the command line.
# Usage:
# Edit `base_uri`.
# fogbugz login email@example.com password
# Copy the returned token and paste on the `default_params` line.
# fogbugz fix 1234 "I IZ TEH AWESOME"
require "rubygems"
require "httparty"
@macournoyer
macournoyer / .gitconfig
Created October 28, 2008 20:42
My .gitconfig
[user]
name = macournoyer
email = macournoyer@gmail.com
[color]
diff = auto
status = auto
branch = auto
[alias]
st = status
co = checkout
@macournoyer
macournoyer / gist:20999
Created October 30, 2008 13:20
Open a new tab in Terminal
#!/usr/bin/env ruby
# Open a new tab in Terminal
# usage: tab [cmd]
# If cmd is specified, it will be run in new tab while old tab is reactivated.
# If no cmd, new tab is activated
require "rubygems"
require "appscript"
include Appscript
window = app("Terminal").windows.first
Teh Ceiling Cat of us, whu haz cheezeburger, yu be spechul
Yu ordered cheezburgerz,
Wut yu want, yu gets, srsly.
In ceiling and on teh flor.
Giv us dis day our dalee cheezburger.
And furgiv us for makin yu a cookie, but eateding it.
And we furgiv wen cats steel our cookiez.
An do not let us leed into teh showa, but deliver us from teh wawter.
Ceiling Cat pwns all. He pwns teh ceiling and teh floor and walls too.
Forevur and evuhr. Amen.
# Memcache-like Invisible app
STORE = {}
with ":key" do
put { STORE[params[:key]] = params[:value] }
get { render STORE[params[:key]] }
end
class User
has_many :cats
end
class UserTest < Test::Unit::TestCase
# Useless
should_have_many :cats
# Useful
def test_should_add_a_cat
From d8d28ef73fdd539e0d6a358b7e3f00ac5317842c Mon Sep 17 00:00:00 2001
From: macournoyer <macournoyer@gmail.com>
Date: Wed, 19 Nov 2008 15:43:45 -0500
Subject: [PATCH] Fix presentable_for so longest presentable name is matched first.
This makes sure subscripton_discount_ is matched before subscripton_.
---
.../lib/active_presenter/base.rb | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
Error while running applet.
processing/core/PApplet.java:1242:in `createGraphics': java.lang.RuntimeException: You need to use "Import Library" to add processing.opengl.PGraphicsOpenGL to your sketch. (NativeException)
from processing/core/PApplet.java:1015:in `size'
from processing/core/PApplet.java:959:in `size'
from sun/reflect/NativeMethodAccessorImpl.java:-2:in `invoke0'
from sun/reflect/NativeMethodAccessorImpl.java:39:in `invoke'
from sun/reflect/DelegatingMethodAccessorImpl.java:25:in `invoke'
from java/lang/reflect/Method.java:585:in `invoke'
from org/jruby/javasupport/JavaMethod.java:250:in `invokeWithExceptionHandling'
from org/jruby/javasupport/JavaMethod.java:219:in `invoke'
#!/usr/bin/env ruby
# List tweets w/ links.
# require: sudo gem install jnunemaker-twitter --source http://gems.github.com
# usage: twitlinks [num]
require "rubygems"
require "twitter"
# EDIT THIS
EMAIL = 'ur@emailz.com'
PASSWORD = 'greenerpoop'