Skip to content

Instantly share code, notes, and snippets.

--- ./pty.c.orig 2003-09-08 16:26:18.000000000 +0200
+++ ./pty.c 2007-10-28 16:27:56.000000000 +0100
@@ -34,7 +34,7 @@
#endif
/* for solaris 2.1, Unixware (SVR4.2) and possibly others */
-#ifdef HAVE_SVR4_PTYS
+#if defined(HAVE_SVR4_PTYS) && !defined(__APPLE__)
# include <sys/stropts.h>
#endif
@jstorimer
jstorimer / gist:409730
Created May 22, 2010 03:28
Git is friendly
→ git pull --rebase mainline master
remote: Counting objects: 110, done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 61 (delta 49), reused 0 (delta 0)
Unpacking objects: 100% (61/61), done.
From github.com:Shopify/shopify
* branch master -> FETCH_HEAD
It seems that I cannot create a rebase-apply directory, and
I wonder if you are in the middle of patch application or another
→ cowsay -g "Happy Birthday Shopify"
________________________
< Happy Birthday Shopify >
------------------------
\ ^__^
\ ($$)\_______
(__)\ )\/\
||----w |
|| ||
@jstorimer
jstorimer / gist:453540
Created June 25, 2010 22:31
Kind of like alias_method_chain for class methods but defined before the aliased method is even defined
module Teacher
def self.included(base)
class << base
def singleton_method_added(name)
return if @done
return unless name == :perform
if name == :perform
@done = true
end
@jstorimer
jstorimer / gist:463916
Created July 5, 2010 01:36
Shell command to update outdated homebrew brews
brew outdated | cut -f 1 -d "(" | xargs brew install
@jstorimer
jstorimer / gist:468147
Created July 8, 2010 15:25
CookieStore fix for Rails 2.3.8
class ActionController::Session::CookieStore
def call_with_cookie_fix(env)
status, headers, body = call_without_cookie_fix(env)
unless headers['Set-Cookie'].blank?
headers['Set-Cookie'] = headers['Set-Cookie'].map(&:strip)
end
[status, headers, body]
end
=== Little subtleties that will trip you up when upgrading your Rails 2.x app to Rails 3.
== ActiveRecord
= ActiveRecord::Base#update_attribute is now much dumber. It now skips validations AND callbacks. It also doesn't
understand associations. Previously if your model belongs_to :invoice you could do:
record.update_attribute(:invoice, nil)
now you need:
[0x104d8f9f0]
#<Module:0x10129fe08>
ActionDispatch::Routing::Helpers
#<Module:0x101af5788>
#<Module:0x101761cc0>
#<Module:0x101769dd0>
SignupHelper
title
ProductsHelper
gem i rails -v=3.0.1
rails new broken-helper-all
cd broken-helper-all
bundle install
rails g controller articles index
rails g controller products index
# helper :all is now the framework default and defined in ActionController::Base
# app/helpers/articles_helper.rb