Skip to content

Instantly share code, notes, and snippets.

Anthony To anthonyto

  • San Diego, CA
Block or report user

Report or block anthonyto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View sql_results.sql
[191] pry(main)> questions.uniq.length
Exam Load (11.7ms) SELECT DISTINCT exams_questions.id as eqid, IF(marked_answer IS NULL, 1, 2) as rank_multiplier, (select rank_multiplier)*exams_questions.updated_at as rank, MAX((select rank)) FROM `exams` INNER JOIN exams_questions ON exams.id = exams_questions.exam_id WHERE `exams`.`deleted_at` IS NULL AND `exams`.`subscriber_id` = 11195 AND `exams`.`status` = 1 AND (admin_exam_id IS NULL) AND (package_id IS NULL) AND (exams_questions.subscriber_id = 11195) GROUP BY exams_questions.question_id
=> 831
[192] pry(main)> questions.where('exams_questions.marked_answer IS NULL').length
Exam Load (2.4ms) SELECT exams_questions.id as eqid, IF(marked_answer IS NULL, 1, 2) as rank_multiplier, (select rank_multiplier)*exams_questions.updated_at as rank, MAX((select rank)) FROM `exams` INNER JOIN exams_questions ON exams.id = exams_questions.exam_id WHERE `exams`.`deleted_at` IS NULL AND `exams`.`subscriber_id` = 11195 AND `exams`.`status` = 1 AND (admin_exam_id IS NULL) A
View CodeWars_Solution.md
@anthonyto
anthonyto / foo.log
Created Mar 2, 2016
Unknown attribute
View foo.log
rake aborted!
ActiveRecord::UnknownAttributeError: unknown attribute 'speciality_id' for Category.
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/attribute_assignment.rb:59:in `rescue in _assign_attribute'
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/attribute_assignment.rb:41:in `block in assign_attributes'
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/attribute_assignment.rb:35:in `each'
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/attribute_assignment.rb:35:in `assign_attributes'
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/core.rb:564:in `init_attributes'
/Users/anthony/.rvm/gems/ruby-2.1.5@emqb/gems/activerecord-4.2.4/lib/active_record/core.rb:281:in `initialize'
/Users/anthony/.rvm/gems/ru
@anthonyto
anthonyto / output.json
Last active Nov 13, 2015
page.driver.network_traffic foo output
View output.json
{
"command_id":"c264f18a-155a-425c-9589-2bee9b0811bb",
"response":{
"1":{
"request":{
"headers":[
{
"name":"Accept",
"value":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
},
@anthonyto
anthonyto / output.json
Created Nov 13, 2015
Page.driver.network_traffic output
View output.json
{
"id":"c7065ee0-d5ad-406d-b607-fc29ccb0a296",
"name":"network_traffic",
"args":[
]
}{
"command_id":"c7065ee0-d5ad-406d-b607-fc29ccb0a296",
"response":{
"1":{
You can’t perform that action at this time.