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
ruby-1.9.2-p0 > User.new.save! | |
ActiveRecord::RecordInvalid: Validation failed: Email is too short (minimum is 6 characters), Email should look like an email address., Email is too short (minimum is 3 characters), Email should use only letters, numbers, spaces, and .-_@ please., Password is too short (minimum is 4 characters), Password confirmation is too short (minimum is 4 characters), First name can't be blank, Last name can't be blank, Company name can't be blank, User type is not included in the list, Company size is not included in the list, Industry is not included in the list |
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
module RequireTimer | |
attr_reader :load_times | |
def self.extended(base) | |
base.instance_variable_set :@load_times, {} | |
end | |
def require(*items) | |
items.each do |item| | |
start = Time.now |
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
SELECT * FROM wp_postmeta | |
WHERE wp_postmeta.meta_key = "_MyEvent" | |
AND STR_TO_DATE(SUBSTR(meta_value, LOCATE('dateStart";s:10:"', meta_value)+17, 10), "%d/%m/%Y") < NOW(); |
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
class Rainbows | |
# (¯`•.•´¯) (¯`•.•´¯) BEST METHOD | |
# *`•.¸(¯`•.•´¯)¸.•´ ♥ EVA! | |
# ☆ º ♥ `•.¸.•´ ♥ º ☆.¸¸.•´¯`♥ | |
def shine | |
end | |
end |
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
<?php // BRAD | |
$numbers = array("1", "2", "3", "4", "5"); | |
function array_print($values) { | |
$array = array_reverse($values); | |
print_values($array); | |
} | |
function print_values($array) { | |
echo array_pop($array); |
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
[~]$ zsh_stats rvm:ruby-1.9.2-p136 | |
334 cd | |
248 git | |
223 ls | |
126 exit | |
125 gitx | |
116 rake | |
112 mate | |
86 node | |
77 clear |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
PADDING = 1 | |
options = { | |
:input => $stdin, | |
:limit => 10 | |
} |
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
[master][~/Projects/crunch/rails]$ jobs rvm:ruby-1.9.2-p136@crunch | |
[1] running rake jobs:work &> /dev/null | |
[2] running rake unicorn &> /dev/null | |
[3] - running coffee -w -c -l -o build/ src/ | |
[4] + running node build/echo.js &> node.log |
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
fizzbuzz = {3 => 'Fizz', 5 => 'Buzz', 15 => 'FizzBuzz'} | |
range = (1..100) | |
replacements = Hash.new {|key, value| value } | |
fizzbuzz.each do |i, replacement| | |
range.each_slice(i) {|i| replacements[i.last] = replacement } | |
end | |
range.each {|i| puts replacements[i] } |