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://aws.amazon.com/ec2/pricing/pricing-on-demand-instances.json | |
class Instance | |
def key_for_type(type) | |
type_translations = { | |
'm1.small' => ['stdODI', 'sm'], | |
'm1.medium' => ['stdODI', 'med'], | |
'm1.large' => ['stdODI', 'lg'], | |
'm1.xlarge' => ['stdODI', 'xl'], |
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
projects = Project.all | |
projects.each do |project| | |
puts "Working with #{project.name}" | |
index = 0 | |
project_total = Recent.where(:project_id => project.id).count | |
user_ids = Recent.where(:project_id => Project.first.id).distinct('user.id') | |
user_ids.each do |user_id| | |
user = User.find(user_id) | |
project_user = user.for_project(project) |
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 'gmail' | |
label = 'MY LABLE' | |
gmail = Gmail.connect('USERNAME', 'PASSWORD') | |
gmail.mailbox(label).emails.each do |email| | |
mailbox = email.sender.first.mailbox | |
host = email.sender.first.host | |
puts "#{mailbox}@#{host}" | |
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
{"subject_ids"=>[BSON::ObjectId('50dcb441a2fc8e37890dafe8')], | |
"annotations"=> | |
[{"species"=>"wildebeest", | |
"count"=>"3", | |
"behavior"=>["eating"], | |
"babies"=>"false", | |
"search"=>""}, | |
{"agent"=> | |
"Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0"}, | |
{"started"=>"Tue, 05 Feb 2013 18:54:39 GMT"}], |
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
language: ruby | |
rvm: | |
- "1.9.3-p392" | |
before_install: | |
- wget https://github.com/zooniverse/redis/archive/zdiffstore.tar.gz | |
- tar -xvzf zdiffstore.tar.gz | |
branches: | |
only: |
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 self.next_original_for_user(user) | |
recents = joins(:classifications).where(:classifications => { :zooniverse_user_id => user.id }).select('subjects.id').all | |
if recents.any? | |
where(['id NOT IN (?)', recents]).first | |
else | |
first | |
end | |
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
class BatDetectiveSubject < Subject | |
include SubjectSelector | |
include SubjectSelector::Unique | |
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
The Zooniverse (zooniverse.org) began in 2007 with the launch of Galaxy Zoo, a project in which more than 175,000 people provided shape analyses of more than 1 million galaxy images sourced from the Sloan Digital Sky Survey. These galaxy 'classifications', some 60 million in total, have subsequently been used to produce more than 50 peer-reviewed publications based not only on the original research goals of the project but also because of serendipitous discoveries made by the volunteer community. | |
Based upon the success of Galaxy Zoo the team have gone on to develop more than 25 web-based citizen science projects, all with a strong research focus in a range of subjects from astronomy to zoology where human-based analysis still exceeds that of machine intelligence. Over the past 6 years Zooniverse projects have collected more than 300 million data analyses from over 1 million volunteers providing fantastically rich datasets for not only the individuals working to produce research from their projects but also |
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
tell application "Google Chrome" to activate | |
tell application "System Events" | |
keystroke "F" using {command down, shift down} | |
end tell | |
delay 10 | |
tell application "System Events" to key code 126 | |
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
// curl -v http://api.figshare.com/v1/articles/821210 | |
{ | |
"count": 1, | |
"items": [{ | |
"article_id": 821210, | |
"title": "Fidgit fileset test", | |
"figshare_url": "http://figshare.com/articles/Fidgit_fileset_test/821210", | |
"views": 40, | |
"downloads": 0, |