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
cookie = 'XXX--YYY' | |
ActiveSupport::MessageVerifier.new(Rails.application.config.secret_token).verify(cookie) |
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
# ey-cloud-recipes/cookbooks/redis-yml/recipes/default.rb | |
if ['app_master', 'app'].include?(node[:instance_role]) | |
redis_instance = node['utility_instances'].find { |instance| instance['name'] == 'redis' } | |
if redis_instance | |
node[:applications].each do |app, data| | |
template "/data/#{app}/shared/config/redis.yml"do | |
source 'redis.yml.erb' | |
owner node[:owner_name] |
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 DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
// Takes a timestamp and converts it to a relative time | |
// DateHelper.time_ago_in_words(1331079503000) |
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 GetCreditCardTypeByNumber(ccnumber) { | |
var cc = (ccnumber + '').replace(/\s/g, ''); //remove space | |
if ((/^(34|37)/).test(cc) && cc.length == 15) { | |
return 'AMEX'; //AMEX begins with 34 or 37, and length is 15. | |
} else if ((/^(51|52|53|54|55)/).test(cc) && cc.length == 16) { | |
return 'MasterCard'; //MasterCard beigins with 51-55, and length is 16. | |
} else if ((/^(4)/).test(cc) && (cc.length == 13 || cc.length == 16)) { | |
return 'Visa'; //VISA begins with 4, and length is 13 or 16. | |
} else if ((/^(300|301|302|303|304|305|36|38)/).test(cc) && cc.length == 14) { |
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/apps/*/shared/*.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 777 root adm | |
} |
NewerOlder