Skip to content

Instantly share code, notes, and snippets.

View ybakos's full-sized avatar
💭
the machine stops the machine stops the machine stops

Yong Joseph Bakos ybakos

💭
the machine stops the machine stops the machine stops
View GitHub Profile

#Dr StrangeCode or "How I Learned to Stop Worrying and Love the Rails 3.0 Upgrade"* I recently upgraded one of my Rails applications from 2.3.5 to 3.0.0 (and from ruby 1.8.7 to 1.9.2). I took a series of notes of all the problems and issues I ran into. ##Ruby 1.8.7 to 1.9.2 upgrade

  • FasterCSV is part of 1.9.2, but not 1.8.7. If you want to maintain compatibility with both, then keep using FasterCSV.
  • ftools no longer exists in ruby 1.9.2. Was using it in a require. I just used fileutils instead.
  • I had a bunch of old-style case/when statements that no longer work in 1.9.
    hours = case r[6..6]
        when "M": [0,11]
 when "A": [12, 18]
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@ybakos
ybakos / gist:1253612
Created September 30, 2011 12:28
my terminator gem error
terminator-0.4.4/lib/terminator.rb:127:in `block in terminate': wrong number of arguments (1 for 0) (ArgumentError)
from /Users/ybakos/projects/261/csci261_grading_toolkit/final/lib/09_bottles/submission.rb:40:in `call'
from /Users/ybakos/projects/261/csci261_grading_toolkit/final/lib/09_bottles/submission.rb:40:in ``'
from /Users/ybakos/projects/261/csci261_grading_toolkit/final/lib/09_bottles/submission.rb:40:in `block in incorporates_user_choice_of_product'
from /Users/ybakos/.rvm/gems/ruby-1.9.2-p180@grading/gems/terminator-0.4.4/lib/terminator.rb:134:in `call'
from /Users/ybakos/.rvm/gems/ruby-1.9.2-p180@grading/gems/terminator-0.4.4/lib/terminator.rb:134:in `terminate'
from /Users/ybakos/projects/261/csci261_grading_toolkit/final/lib/09_bottles/submission.rb:38:in `incorporates_user_choice_of_product'
@cspickert
cspickert / Search Xcode Documentation.applescript
Created April 26, 2012 16:36
Jump to the documentation search field in Xcode 4 using AppleScript.
#!/usr/bin/osascript
-- Jump to the documentation search field in Xcode 4's Organizer
-- To use, make sure "Enable access for assistive devices" is enabled in the Universal Access pref pane
tell application "System Events"
tell process "Xcode"
-- Activate Xcode if necessary
set frontmost to true
@larrybotha
larrybotha / A.markdown
Last active December 28, 2022 19:00
Monokai Sidebar Theme | Sublime Text

Sublime Text Monokai Sidebar Theme

A theme for the sidebar in Sublime Text to match the workspace of the Monokai theme.

This theme only modifies the sidebar to better match the Monokai theme, without modifying any of the styling elsewhere defined by Monokai.

File location: Packages/User

For a theme that extends beyond just the sidebar, visit https://gist.github.com/umpirsky/5842174

@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 2, 2024 03:13
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@zenkay
zenkay / gist:3237860
Created August 2, 2012 15:19
Installation tips for RVM/Ruby on OSX 10.8 Mountain Lion

Ruby, RVM and Mountain Lion

Key problems

Mountain Lion (10.8) has three main difference compared to Lion (10.7):

  • XCode 4.4 does not install Command Line Tools by default
  • X11 isn't available anymore
  • The installed version of OpenSSL has some bugs

How to work around

@elgalu
elgalu / Ruby.tmLanguage
Created October 20, 2012 00:54
Sublime Text - Adding ruby regular expression detection starting and ending with slashes
<!-- elgalu: Adding ruby regular expression detection starting and ending with slashes -->
<dict>
<key>begin</key>
<string>/</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.ruby</string>
anonymous
anonymous / gist:4271964
Created December 12, 2012 21:52
run this in your terminal (mac/linux). via http://www.reddit.com/r/gifs/comments/14p3ip/snowing_cli_style/
clear; while :; do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS)); sleep 0.1; done | awk '{a[$3]=0; for(x in a) {o=a[x]; a[x]=a[x]+1; printf "\033[%s;%sH ",o,x; printf "\033[%s;%sH*\033[0;0H",a[x],x;}}'
@aslakhellesoy
aslakhellesoy / gfm.sh
Last active November 23, 2016 09:57
Compile and show GFM docs in your browser.https://help.github.com/articles/github-flavored-markdown
#!/bin/sh
# Compile and show [GFM](https://help.github.com/articles/github-flavored-markdown) docs in your browser.
# Before this works you need to `gem install bcat`
#
# Usage: gfm.sh FILE.md
#
curl --silent --data-binary @- https://api.github.com/markdown/raw -H "Content-Type: text/plain" | bcat