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
| def post_link_relation(resource, constraint) | |
| post "/links/:link_relation", | |
| to: "#{resource}#update_links", | |
| constraints: { link_relation: constraint }, | |
| format: false | |
| end | |
| def delete_link_relation(resource, constraint) | |
| delete "/links/:link_relation/:link_ids", | |
| to: "#{resource}#destroy_links", |
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
| describe '#login' do | |
| it 'should validate presence' do | |
| expect{ User.create!(name: 't', password: 'password1', email: 'test@example.com') }.to raise_error | |
| end | |
| it 'should validate uniqueness' do | |
| expect{ User.create!(name: 't', login: 't', password: 'password1', email: 'test@example.com') }.to_not raise_error | |
| expect{ User.create!(name: 't', login: 't', password: 'password1', email: 'test2@example.com') }.to raise_error | |
| expect{ User.create!(name: 'T', login: 'T', password: 'password1', email: 'test3@example.com') }.to raise_error | |
| end |
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
| require 'spec_helper' | |
| describe Api::V1::ClassificationsController, type: :controller do | |
| let!(:workflow) { create(:workflow_with_subjects) } | |
| let!(:set_member_subject) { workflow.subject_sets.first.set_member_subjects.first } | |
| let!(:user) { create(:user, cellect_hosts: { workflow.id.to_s => 'http://example.com' }) } | |
| let(:mocked_cellect) do | |
| cellect_connection = instance_double(Cellect::Client::Connection) | |
| expect(Cellect::Client).to receive(:connection).and_return(cellect_connection) | |
| cellect_connection |
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
| function dethrottle { | |
| sudo ipfw delete 1 | |
| } | |
| function throttle { | |
| if test $# -eq 0 | |
| then | |
| echo 'throttle <port> <bandwidth (KB)>' | |
| elif test $# -eq 1 | |
| then |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
| <title>SoundCloud OAuth 2 User Agent Authentication Flow Demo</title> | |
| <script type="text/javascript" charset="utf-8" src="javascript/jquery-1.4.2.js"></script> | |
| <script type="text/javascript" charset="utf-8"> | |
| $(function () { | |
| var extractToken = function(hash) { |
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
| #!/usr/bin/env ruby | |
| # Create a JSON file of all the penguin subject images in the s3 bucket | |
| # combined with the per site/filename provided metadata in CSV files. | |
| require 'aws-sdk' | |
| require 'json' | |
| require 'csv' | |
| require 'active_support' | |
| require 'zooniverse_data' | |
| require 'pry' |
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
| require 'spec_helper' | |
| describe Project, type: :model do | |
| let(:project) { build(:project) } | |
| it "should have a valid factory" do | |
| expect(project).to be_valid | |
| end |
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
| for i in `gem list --no-versions`; do gem uninstall -aIx $i; done |
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
| /* | |
| * CSS Media queries for responsive tables | |
| * http://stackoverflow.com/questions/9746979/tables-in-a-responsive-web-design | |
| * and http://css-tricks.com/responsive-data-tables/ | |
| * | |
| * http://jsfiddle.net/camallen/gvExW/5/ | |
| /* | |
| @media all and (max-width:640px) { | |
| table,thead,tbody,tfoot,th,td,tr{display:block} |
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
| class TriBoolean | |
| attr_reader :value | |
| def initialize(value) | |
| @value = value | |
| end | |
| # Converts an object of this instance into a database friendly value. | |
| def mongoize |