This file contains 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
_loop_playing: (anim) -> | |
if anim.playing == false | |
return true | |
setTimeout( | |
()=> | |
@_loop_playing.apply(this, [anim]) | |
, parseInt(1000 / anim.fps)) |
This file contains 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
module Kaminari | |
class SimplePaginatable | |
DEFAULTS = { | |
:total_count => 0, | |
} | |
include Kaminari::ConfigurationMethods::ClassMethods | |
attr_internal_accessor :limit_value, :offset_value | |
def initialize(options, limit_val = default_per_page, offset_val = 0) #:nodoc: |
This file contains 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 small_tag_start | |
return '' unless request.mobile? | |
case request.mobile | |
when Jpmobile::Mobile::Docomo | |
'<span style="font-size:smaller">' | |
when Jpmobile::Mobile::Au | |
if ['CA31','CA32','CA33','HI33','HI34','HI35','HI36','SA31','TS31','SH3D'].member?(request.mobile.device_id) | |
'<font style="font-size:12px">' | |
elsif ['CA3E','KC35','KC36','KC37','KC38','KC3O','KC3H','KC3K','SH3B','TS3O','TS3H','SN3I','HI3G','KC3R'].member?(request.mobile.device_id) | |
'<font style="font-size:15px">' |
This file contains 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
# -*- coding: utf-8 -*- | |
require 'digest/sha1' | |
require 'db_cache' | |
module ActsAsCached | |
module ClassMethods | |
def acts_as_cached(options = {}) | |
extend RecordCache | |
end |
This file contains 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
# -*- coding: utf-8 -*- | |
require 'memcache_client' | |
require 'singleton' | |
class DBCache | |
include Singleton | |
attr_accessor :connection | |
def load_config |
This file contains 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
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'mechanize' | |
require 'kconv' | |
# settings | |
domain_name = 'YOUR_DOMAIN' | |
repo_name = 'YOUR_REPO' | |
username = 'USERNAME' | |
password = 'PASSWORD' | |
# |
This file contains 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
# -*- coding: utf-8 -*- | |
begin | |
require 'memcached' | |
rescue LoadError | |
require 'memcache' | |
end | |
# memcached のインターフェイスに合わせる | |
class MemcacheClient | |
attr_accessor :connection |
This file contains 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
# -*- coding: utf-8 -*- | |
require 'addressable/uri' | |
module OAuth::RequestProxy | |
class ActionControllerRequest < OAuth::RequestProxy::Base | |
def parameters_for_signature_with_opensocial | |
params = [] | |
params << options[:parameters].to_query if options[:parameters] | |
unless options[:clobber_request] | |
params << header_params.to_query |