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
uuid | location:1 | location:2 | metadata:size | metadata:cuteness | |
---|---|---|---|---|---|
1 | https://placekitten.com/200/300.jpg | https://placekitten.com/200/100.jpg | small | cute | |
2 | https://placekitten.com/400/900.jpg | https://placekitten.com/500/100.jpg | large | cute |
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 'csv' | |
require 'active_support/all' | |
require 'json' | |
require 'pry' | |
output = [] | |
puts "Loading subject info" | |
subjects = CSV.read("subjects.csv", headers: true) | |
subjects = subjects.map {|row| |
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 'csv' | |
require 'json' | |
require 'time' | |
users = {} | |
CSV.new(ARGF, headers: true).each do |row| | |
STDERR.print '.' | |
user_id = row["user_id"] | |
metadata = JSON.parse(row["metadata"]) |
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
class OldInvitationsToFillOutTasks < ActiveRecord::Migration | |
include Roqua::Logging | |
def up | |
Invitation.where(active: true, completed: false, is_template: false) | |
.includes(:questionnaires) | |
.includes(:meas_instance) | |
.includes(:patient) | |
.includes(:team) | |
.find_each do |invitation| |
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
line = (<<-END).strip.chars.to_a | |
'"'hello world"\\", he" said, whil'e \\opening\\' "the door" | |
END | |
elements = [""] | |
mode = nil | |
while char = line.shift | |
puts char | |
case mode |
Let's assume some basic AR stuff:
class Invitation < ActiveRecord::Base
scope :templates, where(template: true)
end
Then we could set up some Pavlov operations, one interactor and some queries and commands:
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
spork_options = {:rspec_env => { 'RAILS_ENV' => 'test' }, :wait => 60, :cucumber => false, :test_unit => false, :rspec_port => 8910 } | |
rspec_options = {:keep_failed => false, :all_after_pass => false, :all_on_start => false, :cli => "--drb --drb-port 8910 -f Fuubar --colour"} | |
teabag_options = {:keep_failed => false, :all_after_pass => false, :all_on_start => false} | |
def self.rspec_tests!(rspec_options) | |
guard :rspec, rspec_options do | |
# Rails example | |
watch(%r{^spec/.+_spec\.rb$}) | |
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } | |
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } |
We can't make this file beautiful and searchable because it's too large.
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
FileName,Gorongosa_id,camera,year,season,month,DateUTC,TimeUTC,time_period,distance_water,distance_human,vegetation_edu,ESId | |
http://zooniverse-export.s3-website-us-east-1.amazonaws.com/21484_1000_D09_Season%201_Set%201_EK001729.JPG,21484_1000_D09_Season 1_Set 1_EK001729,D09,2013,DryWet Oct-Dec,Dec,12/6/2013,12:07:57 PM,Day 0623-1709,3077.7,0.01,Mixed Savanna and Woodland, | |
http://zooniverse-export.s3-website-us-east-1.amazonaws.com/21484_1000_D09_Season%201_Set%201_EK001805.JPG,21484_1000_D09_Season 1_Set 1_EK001805,D09,2013,DryWet Oct-Dec,Dec,12/6/2013,12:06:43 PM,Day 0623-1709,3077.7,0.01,Mixed Savanna and Woodland, | |
http://zooniverse-export.s3-website-us-east-1.amazonaws.com/21484_1000_D09_Season%201_Set%201_EK001725.JPG,21484_1000_D09_Season 1_Set 1_EK001725,D09,2013,DryWet Oct-Dec,Dec,12/6/2013,12:04:55 PM,Day 0623-1709,3077.7,0.01,Mixed Savanna and Woodland, | |
http://zooniverse-export.s3-website-us-east-1.amazonaws.com/21484_1000_D09_Season%201_Set%201_EK001712.JPG,21484_1000_D09_Season 1_Set 1_EK001712,D09 |
NewerOlder