Skip to content

Instantly share code, notes, and snippets.

View brookr's full-sized avatar
💭
🚀

Brook R brookr

💭
🚀
View GitHub Profile
@brookr
brookr / postgresql upgrade.md
Last active December 19, 2015 10:09
Upgrading Postgresql from 9.2 to 9.3.1

Make a temporary home for the new database

mkdir -p /usr/local/var/postgres9.3

Tell postgres to set up the new database

initdb /usr/local/var/postgres9.3 -E 'UTF-8' --lc-collate='en_US.UTF-8' --lc-ctype='en_US.UTF-8'

Migrate the data

pg_upgrade -d /usr/local/var/postgres9.2/ -D /usr/local/var/postgres9.3/ -b /usr/local/Cellar/postgresql/9.2.1/bin/ -B /usr/local/Cellar/postgresql/9.3.1/bin/ -v

Make the new db the canonical db

@brookr
brookr / gist:5778622
Last active December 18, 2015 11:49
Sublime Preferences: Settings - User
{
"save_on_focus_lost": true,
"translate_tabs_to_spaces": true,
"tab_size": 2,
"ensure_newline_at_eof_on_save": true,
"trim_trailing_white_space_on_save": true
}
# Here's a number of different Ruby helper methods can be used to select even numbers from an array
pry(main)> list = [1,2,3,4,5,6,7,8,9,10]
=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
pry(main)> list.select { |n| n % 2 == 0 }
=> [2, 4, 6, 8, 10]
pry(main)> list.select { |n| (n % 2).zero? }
=> [2, 4, 6, 8, 10]
@brookr
brookr / gist:5439800
Last active December 16, 2015 13:09
CodeFellows FAQ

What is Code Fellows?

Web development jobs abound, and companies struggle to fill engineering roles. Lots of technically minded folks like you are interested, but the learning curve is significant.

Code Fellows offers teaching and mentoring services through bootcamps to turn you and other budding web developers in to professional, employable engineers.

We teach industry best practices and tools (that simply aren't covered in universities). We connect you with mentors active in the web development world, and give you personal introductions to companies that are hiring engineers.

Who are the Code Fellows bootcamps for?

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

@brookr
brookr / user_preferences.json
Last active December 14, 2015 13:28
My Sublime settings
{
"font_size": 32.0,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
"save_on_focus_lost": true,
"tab_size": 2,
"translate_tabs_to_spaces": true
}
@brookr
brookr / string equivalency in ruby
Last active December 13, 2015 16:48
Various types of Ruby string equality comparisons
>> s1 = "a"
=> "a"
>> s2 = "a"
=> "a"
>> s3 = s1
=> "a"
>> puts "s1 & s2 #{s1 == s2 ? 'do' : 'do not'} have identical content"
s1 & s2 do have identical content
@brookr
brookr / gist:4676428
Last active December 11, 2015 23:28 — forked from anonymous/gist:4676424
Danny:
<object id="myExperience2098717663001" class="BrightcoveExperience">
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="208" />
<param name="height" value="160" />
<param name="playerID" value="2071055206001" />
<param name="playerKey" value="AQ~~,AAAB4eGobUk~,eISeYOITQnOjwQERkrSD1mcNDIiDNSB7" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="dynamicStreaming" value="true" />
@brookr
brookr / gist:4193101
Last active October 13, 2015 12:07
Examples of how Ruby handles an attribute, a method, and a local variable, all with the same name.
# There are 3 ways to access the value of an instance variable:
# @var, the getter method (eg: var), and self.var (where self is the instance itself)
class Car
attr_accessor :color
def shade
"Some kind of #{@color}."
end
def hue
brookr@falcon.local:~/repos/Knoq.com
(decielo-iteration-6) > cap -S branch="decielo-iteration-6" dev2 deploy
* executing `dev2'
triggering start callbacks for `deploy'
* executing `multistage:ensure'
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers