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
def asset_value_total_by_date_range(beginning_date, end_date \\ Date.utc_today()) do | |
range = "#{Date.diff(end_date, beginning_date)} days" | |
now = Date.utc_today() | |
date_range_query = | |
from(v in AssetValue, | |
select: %{ | |
value: v.value, | |
drange: | |
fragment( |
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
Ingredients | |
2-3lb pork shoulder | |
1 small onion, finely diced | |
1 clove garlic, finely diced | |
2 tbsp olive oil | |
1⁄2 stick + 1 fat pat butter | |
1⁄2 cup flour | |
28oz can crushed tomatoes | |
1 cup red wine |
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
irb(main):001:0> User.exists? | |
users Columns (20.3ms) SHOW FIELDS FROM `users` | |
User Exists (0.3ms) SELECT 1 AS one FROM `users` LIMIT 1 | |
=> true | |
irb(main):002:0> User.where(:email => "foo").exists? | |
User Exists (0.6ms) SELECT 1 AS one FROM `users` WHERE `users`.`email` = 'foo' LIMIT 1 | |
=> false | |
irb(main):003:0> User.where(:email => "foo").present? | |
(0.7ms) SELECT COUNT(*) FROM `users` WHERE `users`.`email` = 'foo' | |
=> 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
Taco Bell Programming - The examples he gives are kind of shit, and I don't really care about the devops | |
bashing part, but the last three paragraphs and overall message are golden. | |
http://widgetsandshit.com/teddziuba/2010/10/taco-bell-programming.html | |
Tech companies: open allocation is your only real option. | |
https://michaelochurch.wordpress.com/2012/09/03/tech-companies-open-allocation-is-your-only-real-option/ | |
http://warpspire.com/posts/million-dollar-products/ |
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
osascript -e "tell application \"Terminal\" to set the font size of window 1 to 18" | |
touch ~/.hushlogin | |
xcode-select --install | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
brew install \ | |
asdf \ |
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
words_to_redact = ["foo", "bar"] | |
sentance = "This is a sentance to redact, foo" | |
words = sentance.split(" ") | |
words.map do |word| | |
if words_to_redact.include?(word) | |
"REDACTED" | |
else | |
word | |
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
cl_cmdrate "128" | |
cl_updaterate "128" | |
cl_disablehtmlmotd "1" | |
cl_forcepreload "1" | |
cl_interp "0" | |
cl_interp_all "0" | |
rate "1048576" | |
cl_crosshairalpha "255" | |
cl_crosshaircolor "5" |
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
irb(main):001:0> foo | |
NameError: undefined local variable or method `foo' for main:Object | |
from (irb):1 | |
from /Users/egunderson/.rubies/ruby-2.1.2/bin/irb:11:in `<main>' | |
irb(main):002:0> foo = 'bar' if false | |
=> nil | |
irb(main):003:0> foo | |
=> nil | |
irb(main):004:0> |
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
ActiveRecord::Base.logger = nil | |
connection = ActiveRecord::Base.connection; nil | |
connection.tables.each do |table| | |
columns = connection.columns(table).map(&:name).select {|x| x.ends_with?("_id")} | |
indexed_columns = connection.indexes(table).map(&:columns).flatten.uniq | |
unindexed = columns - indexed_columns | |
unless unindexed.empty? | |
puts "#{table}: #{unindexed.join(", ")}" | |
end | |
nil |
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
Programming Elixer | |
http://pragprog.com/book/elixir/programming-elixir | |
Programming Clojure | |
http://pragprog.com/book/shcloj2/programming-clojure | |
Web Development with Clojure | |
http://pragprog.com/book/dswdcloj/web-development-with-clojure | |
Purely Functional Data Structures |
NewerOlder