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
configure: WARNING: unrecognized options: --without-tcl, --without-tk | |
checking build system type... x86_64-apple-darwin13.0.0 | |
checking host system type... x86_64-apple-darwin13.0.0 | |
checking target system type... x86_64-apple-darwin13.0.0 | |
checking for gcc-4.2... gcc-4.2 | |
checking for gcc... (cached) gcc-4.2 | |
checking whether the C compiler works... no | |
configure: error: in `/Users/tal/.rvm/src/ruby-2.0.0-p247': | |
configure: error: C compiler cannot create executables | |
See `config.log' for more details |
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
module RedisHashStore | |
module ClassMethods | |
end | |
module InstanceMethods | |
def redis_hash_store_key | |
@redis_hash_store_key ||= "#{self.class.redis_hash_store_key}:#{self.send(self.class.redis_hash_store_uid)}" | |
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
local keys = redis.call('keys',KEY[1]) | |
local ret = {} | |
for i,key in ipairs(keys) do | |
local keyname = key:sub(1,-2) | |
local members = redis.call('lrange', key,0 ,-1) | |
ret[i] = {keyname, members} |
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
local isdigest = redis.call('srem', "digest:users", ARGV[1]) | |
local keys = redis.call('keys', "digest:"..ARGV[1]..":*") | |
local ret = {} | |
for i,key in ipairs(keys) do | |
local dict = {} | |
local keyname = key:gsub("digest:"..ARGV[1]..':','') |
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
config.action_controller.asset_host = Proc.new do |source, request=nil| | |
protocol = request.andand.ssl? ? "https" : "http" | |
protocol << "://dzb99dkvx454e.cloudfront.net" | |
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
<%= table_for(@users) do |user| %> | |
<% column '', user.class.to_s.first %> | |
<% column 'ID', link_to(user.id, admin_user_path(user)) %> | |
<% column 'Name', user.name %> | |
<% column 'Email', user.email.andand.key %> | |
<% column 'Facebook' do %> | |
<% if user.facebook %> | |
<%= link_to user.facebook.key, "https://facebook.com/#{user.facebook.key}", target: "_blank" %> | |
<%= 'token' if user.facebook.access_token %> | |
<% 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
module HasProviderSubclass | |
USERS = [] | |
module ClassMethods | |
def type_to_class_string type | |
@type_to_class_string ||= Hash.new do |h, type| | |
h[type] = "#{self.to_s}::#{type.classify}" | |
end | |
@type_to_class_string[type] | |
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
module RequestPagination | |
def self.included(klass) | |
klass.scope :paginate_from, ->(request,limit=nil) do | |
dset = self | |
if id = request.headers['X-delight-lt-id'] | |
dset = dset.where(:_id.lt => id) | |
end | |
if limit = request.headers['X-delight-item-limit']||limit | |
dset = dset.limit(limit) |
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 Contact < Person | |
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
module Helpers | |
def self.constantize(camel_cased_word) | |
names = camel_cased_word.split('::') | |
names.shift if names.empty? || names.first.empty? | |
constant = Object | |
names.each do |name| | |
constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name) | |
end | |
constant |