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
step 1 | |
change things on your branch, | |
commit them with a sensible name on your branch. | |
step 2 | |
switch to master, | |
pull from origin, merge where needed. | |
step 3 | |
switch to your branch |
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
@blah = | |
one: 1 | |
two: 2 | |
add_more_blah = (@blah)-> | |
{ | |
one: @blah.one | |
two: @blah.two | |
three: 3 | |
four: 'why not have a string?' |
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
[1] pry(#<LogoQuestion>)> url | |
=> "https://quizall_assets.s3.amazonaws.com/logo_questions/logos/000/000/001/original/shell.png?1412259727" | |
[2] pry(#<LogoQuestion>)> open(url,&:read) | |
URI::InvalidURIError: the scheme https does not accept registry part: quizall_assets.s3.amazonaws.com (or bad hostname?) | |
from /Users/anders/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/uri/generic.rb:214:in `initialize' | |
[3] pry(#<LogoQuestion>)> |
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
{"categories":["Sport","Animals","Geography"],"levels":["Level1","Level2","Level3"],"items":[{"id":"logo_question 1","question":"Question for level Level1, category Sport, with the logo id of 1","answer":{"id":4,"logo_question_id":1,"answer":"true","created_at":"2014-10-01T14:49:39.985Z","updated_at":"2014-10-01T14:49:39.985Z"},"hints":["sample hint"],"options":["false","false","false","true"],"src":"data:image/png;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAICAgICAQICAgIDAgIDAwYEAwMD AwcFBQQGCAcJCAgHCAgJCg0LCQoMCggICw8LDA0ODg8OCQsQERAOEQ0ODg7/ 2wBDAQIDAwMDAwcEBAcOCQgJDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4O Dg4ODg4ODg4ODg4ODg4ODg4ODg4ODg7/wAARCAHgAoADASIAAhEBAxEB/8QA HgAAAQQDAQEBAAAAAAAAAAAABgMEBQcBAggACQr/xABIEAABAwIEAwYDBgUD AwMDAwUBAgMRAAQFEiExBkFRBxMiYXGBFDKRI0KhscHwCBVS0eEzYvEWJHJD U4IXNJIYJaJjc5Oy0v/EABwBAAIDAQEBAQAAAAAAAAAAAAMEAQIFBgAHCP/E ADkRAAICAQMDAwEHAwMEAQUAAAABAhEDBBIhBTFBEyJRYQYycYGRodEUFbFC 4fAjM2LBQyRSU5Lx/9oADAMBAAIRAxEAPwD5mIB+8SJNb5TMSCB51rEAqVqZ 0PXfSlEkhMjTqI+tc22b7FhGUEJ1OhPWvLTCDkG596wCMs7ka |
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
I need 100 usernames some may fail the test | |
def get_usernames | |
response = [] | |
#loop | |
name = random_name() | |
response << random_name unless User.find(username: name) | |
#end loop | |
response | |
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
(function(){ | |
window.onerror = function(err,fn,ln) { | |
alert("ERROR:" + err + ", " + fn + ":" + ln); | |
}; | |
window.namespace.ImageDownload = function(){ | |
$('#test').click(function(event){ | |
event.preventDefault(); | |
get_fs(function(fs){ | |
var directory = 'sample'; | |
fs.root.getDirectory(directory, { |
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
$(quizall).trigger('category_levels_choice',{ | |
game: 'logos_questions', | |
callback: function(category, level){ console.log(category, level); } | |
}); |
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
var hints = [ 'hint1', 'hint two', 'hint three', 'hint 4' ]; | |
var hints_with_ids = hints.map(function(hint, index){ | |
return { name: 'hint' + index, hint: hint } ; | |
}); | |
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
$(quizall).trigger('get_categories', { | |
game: 'true_false', | |
complete: function(categories){ | |
//do something with categories here | |
} | |
}); |
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
$(quizall).trigger('post_score', { | |
game: 'true_false', | |
level: 'Level1', | |
score: 100, | |
complete: function(options){ | |
if(options.success !== true){ | |
//provide answer via options.details | |
} | |
if(options.location === 'local'){ | |
//redirect to whichever page you like |