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
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
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
require 'benchmark/ips' | |
require 'multi_json' | |
require 'json' | |
require 'msgpack' | |
hash = { | |
"site_config"=> | |
{ | |
"created_at"=>"2014-03-24T19:58:25Z", | |
"data"=>"", |
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
require 'zeus/rails' | |
class CustomPlan < Zeus::Rails | |
def sidekiq | |
# Based on bin/sidekiq | |
require 'sidekiq/cli' | |
begin | |
cli = Sidekiq::CLI.instance | |
cli.parse |
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
require "sinatra/base" | |
require "puma" | |
require "rack/handler/puma" | |
require "minitest/autorun" | |
require "net/http" | |
require "slim" | |
class App < Sinatra::Base | |
post "/" do |
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
/var/apps/*/shared/*.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 777 root adm | |
} |
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
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 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 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 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
rand(36**8).to_s(36) |
This file has been truncated, but you can view the full file.
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
Date/Time: 2015-11-25 09:39:59 -0500 | |
OS Version: Mac OS X 10.11.1 (Build 15B42) | |
Architecture: x86_64 | |
Report Version: 22 | |
Command: OpenEmu | |
Path: /Applications/OpenEmu.app/Contents/MacOS/OpenEmu | |
Version: ??? (1.0.4) | |
Parent: launchd [1] | |
PID: 26364 |
OlderNewer