Public Gists by nakajima

Gravatar
Mon Nov 23 07:03:45 -0800 2009
1
2
3
module InstanceVariableHelper
  def ivar(name, val=nil)
    if val
Gravatar
Tue Oct 27 16:09:47 -0700 2009
1
2
3
require 'ruby2ruby'
require 'test/unit'
 
gist: 215407 Useful for incrementing/dec...
Gravatar
Wed Oct 21 12:55:43 -0700 2009
1
2
3
(function($) {
  function perform(elem, i) {
    var oldVal = Number(elem.text());
Gravatar
Tue Oct 20 19:23:09 -0700 2009
1
2
3
(function($) {
  $.fn.fadeToggle = function() {
    var elem = $(this);
gist: 214757 Sort of a tooltip dialogue
Gravatar
Tue Oct 20 17:58:23 -0700 2009
1
2
3
(function($) {
  function launchToologue(event) {
    var tooltip, elem;
Gravatar
Mon Oct 19 08:38:02 -0700 2009
1
2
3
require 'nokogiri'
 
# Usage:
Gravatar
Fri Oct 09 14:26:21 -0700 2009
1
2
3
require 'rack'
require 'rack-flash'
 
Gravatar
Thu Sep 10 16:46:33 -0700 2009
1
2
3
Hello competitor,
 
We are glad to report you that in our stable company, the vacancy of transaction manager is opened. The world is smashed by a crisis, people lose their workplaces, and many companies are being closed. Our company offers a product in the field of services; therefore the demand on our suggestions remains even in so difficult period for the world economy.
Gravatar
Sat Sep 05 14:58:05 -0700 2009
1
2
3
require 'acts_as_fu'
 
build_model(:people) do
Gravatar
Tue Aug 25 15:39:08 -0700 2009
1
2
3
ftw = {
  :a => 42,
  :b => 43
Gravatar
Thu Aug 13 13:57:57 -0700 2009
1
2
3
# a
# ab
# abc
Gravatar
Tue Aug 04 10:32:48 -0700 2009
1
2
3
[~/Desktop/gist-161426][master] spec rack-flash\ spec.rb
....
 
Gravatar
Mon Aug 03 10:55:51 -0700 2009
1
2
3
/*** jQuery Form Event Bubbler ***
 
Fakes form submission event bubbling for certain forms by triggering
Gravatar
Fri Jul 31 21:22:18 -0700 2009
1
2
3
# Start the app, then go to "/30" for a 30 second countdown.
 
require 'sinatra'
Gravatar
Thu Jul 30 23:36:37 -0700 2009
1
2
3
# Probably an easier way to achieve tab completion
 
require 'abbrev'
Gravatar
Fri Jun 26 17:25:37 -0700 2009
1
Here's an example refactoring from http://www.workingwithrails.com/forums/4-ask-a-rails-expert/topics/789-optimising-code
Gravatar
Fri Jun 19 01:34:23 -0700 2009
1
2
3
Rails::Initializer.run do |config|
 
  # Require the latest version of haml
Gravatar
Fri Jun 12 16:54:05 -0700 2009
1
2
3
(function() {
  var value, timer; letters=[];
  var writebox = $('writebox');
Gravatar
Fri Jun 12 15:45:27 -0700 2009
1
2
3
# Figure out what's missing from fakefs
#
# USAGE
Gravatar
Fri Jun 05 02:31:21 -0700 2009
1
2
3
# Not exactly sure what I'm doing here...
class RestKlass
  %W[get post put delete].each { |verb|