- Add all the
globalVariablesto the scope. - Add all the
instanceVariablesto the object prototype. - Add all the
objectsto the scope. - Add all the
abilitiesto the scope. - Add all the
scenesto the scope.
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
| <html> | |
| <head> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.5.1/pixi.min.js"></script> | |
| <script src="index.js"></script> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
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
| comment = "# frozen_string_literal: true\n" | |
| filemode = "r+" | |
| dirs = Dir[Rails.root.join('spec/**/*.rb').to_s] + Dir[Rails.root.join('lib/**/*.rake').to_s] + Dir[Rails.root.join('lib/**/*.rb').to_s] | |
| dirs.each do |filename| | |
| contents = File.open(filename, "r") do |f| | |
| f.read | |
| end | |
| contents = comment + contents |
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
| // These are mappings of numbers to actual types that we use in Hopscotch. | |
| // Default is to start at 0 and add 1 to the previous number unless explicitly set to something else. | |
| typedef NS_ENUM(NSInteger, HSBlockType) { | |
| HSBlockTypeNone = 22, | |
| HSBlockTypeMove = 23, | |
| HSBlockTypeRotate = 24, | |
| HSBlockTypeChangeX = 27, | |
| HSBlockTypeChangeY = 28, | |
| HSBlockTypeScale = 29, |
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
| { | |
| "project_object_ids" : { | |
| "object_ids" : [], | |
| "block_ids" : { | |
| "script_block_ids" : [1, 2, 3, 5], | |
| "parameter_blocks" : [] | |
| }, | |
| "rule_ids" : [], | |
| "script_ids" : { |
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 ProjectMaker | |
| def original_json | |
| '{ | |
| "rules" : [ | |
| { | |
| "objectID" : "966281C2-C13C-4CC0-9E5E-00A2CF1D363C-28679-00001DADC7E1BB63", | |
| "abilityID" : "0C0AC15D-34D4-4411-AE82-0B1FE1B85D49-28679-00001DADC7E4CA0B", | |
| "parameters" : [ | |
| { | |
| "type" : 42, |
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 find_projects(date_str) | |
| start_date = Date.parse(date_str) | |
| end_date = start_date + 1.month | |
| Project.published.filtered.where("created_at > ? AND created_at <= ?", start_date, end_date) | |
| end | |
| def has_thing(project, method) | |
| project.send(method).present? && project.send(method) > 0 | |
| 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
| Category.all.each do |c| | |
| has_been_played = c.projects.where("has_been_removed IS NOT TRUE AND play_count > 0").count | |
| all_projects = c.projects.where("has_been_removed IS NOT TRUE").count | |
| ratio = has_been_played.to_f/all_projects.to_f | |
| puts "#{c.label} has #{ratio*100} percent played" | |
| has_been_starred = c.projects.where("has_been_removed IS NOT TRUE AND stars_count > 0").count |
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 = Category.all | |
| categories.each do |c| | |
| has_been_played = c.projects.where("has_been_removed IS NOT TRUE AND play_count > 0").count | |
| all_projects = c.projects.where("has_been_removed IS NOT TRUE").count | |
| ratio = has_been_played.to_f/all_projects.to_f | |
| puts "#{c.label} has #{ratio*100} percent played" | |
| has_been_starred = c.projects.where("has_been_removed IS NOT TRUE AND stars_count > 0").count |
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 query_for_terms(terms) | |
| query = "" | |
| terms.each do |term| | |
| query += "lower(substring(title from 0 for 30)) LIKE '%#{term}%' OR " | |
| end | |
| query.chomp("OR ") | |
| end | |
| def projects_arel(weeks_ago) |
NewerOlder