Skip to content

Instantly share code, notes, and snippets.


Bansal bansalgagan

View GitHub Profile
View gist:c19755376871551d6d97

OS X Preferences

#Disable window animations
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false

#Enable repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
View countAnnotations.rb
for i in 0..Question.all.count-1
current_question = Question.all.skip(i).first
annotations = Annotation.by_question_id.key(
annotation_count = Annotation.by_question_id.key(
if annotation_count != 0
annotations.each do |anno|
src = User.get(anno.user_id).src
#puts src
if src != "amt"
annotation_count = annotation_count - 1
bansalgagan / submitJobs.rb
Last active Aug 29, 2015
Submit the URL of each task to the “job” API along with instructions, payout and other information.
View submitJobs.rb
uri = URI.parse("")
http =, uri.port)
request =
body = {
"type" => "WEBTASK",
"name"=> "PraxEng: English Comprehension Questions",
"payout"=> 1, "min_responses"=> 5,
"job_url"=> "" % 0,
"instructions"=> ["You will be presented with sentences one by one.", "You have to carefully read the sentence and figure out the relation between the marked entities...","Your task is to determine for each sentence what relations it expresses between marked entities.For example, for the entities <span style=\'color:red;\'>Bashar Assad</span> and <span style=\'color:blue;\'>Syria</span> in the sentence <p>&ldquo;<span style=\'color:blue\'>Syria</span>\'s president, <span style=\'color:red\'>Bashar Assad</span>, gave a speech on Tuesday.&rdquo;</p> the relation <strong>has nationality</strong> is correct since by reading the sentence, someone should understand that Bashar Assad\'s