- Prepare disk with gparted:
- Terminal:
-
sudo DISPLAY=:5 gparted
- Device > Create Partition Table:
- Partition table type:
gpt
- Partition > New:
- Create as:
Primary Partition
- File system:ext4
- Edit > Apply All Operations
- Partition > Manage flags:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Visit printed URL in a real browser. When done press enter/return to resume | |
# Cucumber run. | |
Then(/^log current URL$/) do | |
STDOUT.print " >>>>>> current_url: #{current_url}" | |
STDIN.gets | |
end |
I hereby claim:
- I am jimeh on github.
- I am jimeh (https://keybase.io/jimeh) on keybase.
- I have a public key whose fingerprint is F0FD DA8B 81F8 3800 1ADF E59E B85A 9E6D 6BBB 670E
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts defined?(hello).inspect # => nil | |
puts "this will not print #{hello.inspect}" rescue nil | |
hello = 'dude' if false | |
puts defined?(hello).inspect # => "local-variable" | |
puts hello.inspect # => nil | |
# Outputs: | |
# | |
# nil | |
# "local-variable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# | |
# weight.rb (A Ruby on Rails Model). | |
# Lets you pick a row from a table randomly based on the rows weight. | |
# | |
# Your table will need three columns: | |
# - weight (float) | |
# - weight_begin (float) | |
# - weight_end (float) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# The dumbest piece of code I've EVER written. | |
# | |
# I REALLY don't know WTF I was thinking, or not thinking. | |
# I must have been drunk and asleep while I wrote this method. | |
# | |
# It's not only stupid, but IT DOESN'T EVEN WORK! *stabs self in face* | |
# | |
def stupid_method |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Run multiple system commands in parallel | |
# | |
def call_parallel(cmds = [], check_interval = nil) | |
if cmds.size > 0 | |
threads, results = [], [] | |
cmds.each do |cmd| | |
threads << Thread.new { results << [cmd, `#{cmd}`, $?] } | |
end | |
is_done = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dump database "hello_world" | |
$ ./dump_to_s3.rb hello_world | |
dumping hello_world database... | |
uploading /mnt/hello_world-2009-10-30_12-11-44.sql_aa to S3. | |
uploading /mnt/hello_world-2009-10-30_12-11-44.sql_ab to S3. | |
uploading /mnt/hello_world-2009-10-30_12-11-44.sql_ac to S3. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "friendly" | |
require "models/user" | |
Friendly.configure( | |
:adapter => "mysql", | |
:host => "localhost", | |
:user => "root", | |
:password => "boot", | |
:database => "friendlyplay" |
OlderNewer