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 DISTINCT message_id | |
FROM SELECT *, id AS message_id FROM user_messages WHERE user_id = ? | |
AND read = false AND parent_id IS NULL AS initial_messages | |
UNION | |
SELECT *, parent_id AS message_id FROM user_messages WHERE user_id = ? | |
AND read = false AND parent_id IS NOT NULL AS replies; |
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
Remember to use BigDecimal when multiplying floats in Ruby! | |
ruby-1.9.2-p290 :001 > 8.19 * 1_000_000.0 | |
=> 8189999.999999999 |
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
for i in `git br -r | grep -v master | sed 's/origin\///'` ; do git push origin :$i ; sleep 1 ; done |
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 Rails | |
# Don't abort when tests fail; move on the next test task. | |
# Silence the default description to cut down on `rake -T` noise. | |
class SubTestTask < Rake::TestTask | |
# Create the tasks defined by this task lib. | |
def define | |
lib_path = @libs.join(File::PATH_SEPARATOR) | |
task @name do | |
puts "running sub test task #{@name}" | |
run_code = '' |
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
justin ~/Code/atea $ lein clean | |
justin ~/Code/atea $ lein deps | |
Copying 4 files to /Users/justin/Code/atea/lib | |
Copying 2 files to /Users/justin/Code/atea/lib/dev | |
justin ~/Code/atea $ lein native-deps | |
WARNING: lancet namespace is deprecated; use lancet.core. | |
[WARNING] POM for 'org.clojars.pka:jdic-macos-tray:pom:0.0.2:compile' is invalid. | |
Its dependencies (if any) will NOT be available to the current build. | |
Expanding: /Users/justin/.m2/repository/org/clojars/pka/jdic-macos-tray/0.0.2/jdic-macos-tray-0.0.2.jar into /Users/justin/Code/atea |
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 'rspec' | |
module Dog | |
def self.bark | |
"Woof!" | |
end | |
end | |
describe "Rspec re-setting stubs on classes" do | |
it "should return 'Woof!'" do |
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
fsync = false | |
full_page_writes = false | |
bgwriter_lru_maxpages = 0 | |
autovacuum = off |
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
(ns euler.p8) | |
(defn ones-digit-of | |
[number] | |
(mod number 10)) | |
(defn shift-digit-from | |
[number] | |
(/ (- number (ones-digit-of number)) 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
I'm giving a talk on Ruby at EAFIT in Medellin next week! Below are the details: | |
Fecha: Martes 24 de julio | |
Hora: 6:00 a 7:00 PM | |
Lugar:27-103 | |
It's open to the public, but if you're not with the university tweet me and I'll forward your name to the University so that you can be put on the list for security. | |
My cell phone is 320-652-4001, call me if you have any problems getting in or questions about the event and I'll see what I can do to help. You can also tweet @justinleitgeb with any questions or comments. |
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
for bottle in `brew list` ; do brew remove $bottle && brew install $bottle ; done |