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 "fileutils" | |
| require "rmagick" | |
| FileUtils.mkdir_p("./processed") | |
| paths = Dir.glob("./monsters/**/*.png") | |
| paths.each_with_index do |path, i| | |
| canvas = Magick::Image.new(200, 140) do | |
| self.background_color = "none" |
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 'rspec/core' | |
| require 'power_assert' | |
| module PowerAssertExtension | |
| def power_assert(&block) | |
| ::PowerAssert.start(block, assertion_method: __method__) do |pa| | |
| return if pa.yield | |
| message = "\n#{pa.message_proc.call}" | |
| raise RSpec::Expectations::ExpectationNotMetError.new(message) |
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 'openssl' | |
| require 'base64' | |
| require 'net/http' | |
| module Verify | |
| module InAppPurchase | |
| extend self | |
| PRODUCTION_VERIFICATION_END_POINT = "https://buy.itunes.apple.com/verifyReceipt" | |
| SANDBOX_VERIFICATION_END_POINT = "https://sandbox.itunes.apple.com/verifyReceipt" |
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 checkOff($) { | |
| var checkbox = $('.popupContent span[aria-checked="false"]'); | |
| if (!!checkbox) { | |
| checkbox.click(); | |
| checkOff($); | |
| } | |
| } | |
| checkOff($); |
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 'sass' | |
| BASE_SCSS_LOAD_PATH = './assets/www/app/stylesheets/main.css.scss' | |
| KEYFRAMES_OUTPUT_PATH = "./assets/www/app/stylesheets/android_keyframes.css.scss" | |
| class Sass::Tree::Visitors::ToArray < Sass::Tree::Visitors::Base | |
| protected | |
| def initialize | |
| @array = [] | |
| 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
| window.ViewPortAdjuster = { | |
| viewport_width: 320, | |
| viewport_height: 480, | |
| zoom_ratio: 1, | |
| adjust: function() { | |
| var that=this,portrait_width,landscape_width; | |
| $(window).bind("resize", function(){ | |
| if(Math.abs(window.orientation) === 0){ | |
| if(/Android/.test(window.navigator.userAgent)){ | |
| if (!portrait_width) portrait_width = $(window).width(); |
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
| /** with jqmobi **/ | |
| var createTabRenderer = function(parent_target) { | |
| var tab_id = 0; | |
| $(parent_target + ' .tab').each(function() { | |
| $(this).data('tab-id', tab_id); | |
| tab_id += 1; | |
| }); | |
| tab_id = 0; | |
| $(parent_target + ' .list_for_tab').each(function() { | |
| $(this).data('tab-id', tab_id); |
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
| IMAGES_PATH = "images/" | |
| OUTPUT_PATH = "javascripts/" | |
| images = Dir.glob(IMAGES_PATH + "**/*.jpg").join("','") | |
| js_str = <<-JS_STR | |
| (function() { | |
| var image_preloader = { | |
| images: ['#{images}'], | |
| done: function() { |
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 Counter() { | |
| var count = 0; | |
| return function() { | |
| count += 1; | |
| return count; | |
| } | |
| } | |
| function startAnimation(func, duration, animation_size, params) { | |
| var animationCounter = Counter(); |