This file contains hidden or 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
## where header is the first line, and data is a data line | |
Hash[header.zip(data.map{|d| d})].map{|k, v| transform_key_value(k, v)} | |
def transform_key_value(k, v) | |
if v == "true" | |
[k, true] | |
elsif k == "neighborhood" || k == "cuisine" || k == "category_labels" | |
[k, v.split(",").map{|e| e.strip}] | |
elsif k == "hours" |
This file contains hidden or 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
# 1. Use .erb templates to create custom .conf files based on each server’s config | |
# Config is held inside capistrano deploy files, like | |
/config/deploy/staging.rb | |
set :rails_env, "staging" | |
namespace :nginx do | |
# The /etc/init.d/nginx script points to /home/travel/apps/ShortTrips/shared/config/nginx.conf | |
# To deploy changes, run: | |
# cap nginx:configure |
This file contains hidden or 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
Option | pluses | minuses | |
---|---|---|---|
new 'tasks' table | clean | big refactor | |
'tasks' tracking-only table | partial refactor | messy | |
'last_updated' table | simple | easily queryable? |
This file contains hidden or 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
column | data type | |
---|---|---|
id | autoincrement | |
job_id | integer | |
task_id | integer | |
state | integer | |
last_updated | datetime |
This file contains hidden or 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
column | data type | |
---|---|---|
id | autoincrement | |
job_id | integer | |
task_id | integer | |
last_updated | datetime |
This file contains hidden or 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
column | data type | |
---|---|---|
id | autoincrement | |
tasks | integer[] |
This file contains hidden or 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
id | tasks | comments | |
---|---|---|---|
1 | {4,3,1,1,0} | values [id,state] [0,'finished'], [1,'deleted'], [2,'started'], [3,'started'], [4,'created'] |