Skip to content

Instantly share code, notes, and snippets.

@dkaufman
dkaufman / ladder.md
Created June 8, 2018 18:43 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@dkaufman
dkaufman / test.csv
Created March 27, 2018 21:31
Test CSV
name occupation
Dan Plumber
Mike Carpenter
@dkaufman
dkaufman / gist:2865365
Created June 3, 2012 23:12
Hungry Academy God Configuration Instructions
First you need to install god on your server.
gem install god
Then, create your god configuration file with the extension .god. For the simplest configuration, write a god watch block for each of your services like below:
God.watch do |w|
w.name = "redis"
w.start = "redis-server /usr/local/etc/redis.conf"
w.keepalive
end
@dkaufman
dkaufman / hungry.god
Created June 3, 2012 22:18
Sample God Configuration File for Hungry Academy
God.watch do |w|
w.name = "nginx"
w.start = "sudo service nginx start"
w.keep_alive
end
God.watch do |w|
w.name = "varnish"
w.start = "sudo varnishd -f /etc/varnish/default.vcl -s malloc,100M -T 127.0.0.1:2000"
w.keep_alive
SELECT merchants.name, SUM(quantity) FROM invoice_items
INNER JOIN invoices ON invoice_items.invoice_id = invoices.id
INNER JOIN merchants ON invoices.merchant_id = merchants.id
WHERE invoice_items.invoice_id IN
(SELECT invoices.id FROM invoices
INNER JOIN transactions ON invoices.id = transactions.invoice_id
AND transactions.result LIKE 'success')
GROUP BY merchants.id
ORDER BY SUM(quantity) DESC
SELECT SUM(invoice_items.quantity*invoice_items.unit_price) FROM invoices
INNER JOIN invoice_items ON invoices.id = invoice_items.invoice_id
INNER JOIN transactions ON invoices.id = transactions.invoice_id
WHERE transactions.result LIKE 'success' AND Date(invoices.created_date) = Date('2012-03-20')