- body file path:
%s/\(body\: \)\(File.\+\)\(Rails\.root\), \([^)]\+\))/\1\3.join(\4/g
- headers top-level:
%s/\(content_type\:[^,)]\+\)/headers: { \1 }/g
bundle exec rspec `git status --porcelain | sed -e "s/ M /.\//" | grep "spec\.rb"`
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
-- KEYS[1] namespace/key | |
-- ARGV[1] current timestamp | |
-- ARGV[2] max uses per second | |
local t = tonumber(redis.call("get", KEYS[1] .. ":t")) or 0 | |
local c = tonumber(redis.call("get", KEYS[1] .. ":c")) or 0 | |
local current = tonumber(ARGV[1]) | |
local max = tonumber(ARGV[2]) | |
if current - t >= 1 then | |
redis.call("mset", KEYS[1] .. ":t", current, KEYS[1] .. ":c", 1) | |
return {current, 1, 1} |
Install iodbc /usr fix for Mac, third link
http://www.iodbc.org/dataspace/iodbc/wiki/iODBC/Downloads#Mac_OS_X
Now you build psqlODBC
curl http://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-09.03.0210.tar.gz -o psqlodbc-09.03.0210.tar.gz
tar -xzf psqlodbc-09.03.0210.tar.gz
cd psqlodbc-09.03.0210.tar.gz
./configure --with-iodbc=/usr/local/iODBC/ --enable-pthreads --without-libpq
- https://2014.spaceappschallenge.org/challenge/climate-and-my-neighborhood/
- http://data.nasa.gov/
- http://aws.typepad.com/aws/2013/11/process-earth-science-data-on-aws-with-nasa-nex.html
- https://portal.nccs.nasa.gov/portal_home/published/NEX.html
- https://portal.nccs.nasa.gov/portal_home/published/NEX-DCP30_Tech_Note_v0.pdf
- https://nex.nasa.gov/nex/projects/1348/
- https://nex.nasa.gov/nex/projects/1348/wiki/general_data_access_and_apis/
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
........ ........ | |
........ ........ | |
........ how . big ........ | |
........ ........ | |
........ ----- ----- ........ | |
........ I . |____ ........ | |
........ I | ........ | |
........ ----- ----- ........ | |
........ ........ | |
........ the conclusion...? ........ |
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
entries.each do |e| | |
begin | |
do_stuff(e) | |
rescue => error | |
$redis.lpush("failed_strip", e.id) # will create the list and/or append the value | |
end | |
# counting | |
puts "failed: " + $redis.llen("failed_strip") |
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
# http://redis.io/commands/rpoplpush | |
module Resque | |
def self.move_queue(source, destination) | |
r = Resque.redis | |
r.llen("queue:#{source}").times do | |
r.rpoplpush("queue:#{source}", "queue:#{destination}") | |
end | |
end | |
end |