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
namespace :sidekiq do | |
detect_duplicate_processes = ->(context, server) do | |
number_of_sidekiq_processes = context.capture('ps aux | grep "[s]idekiq" | wc -l').to_i | |
rails_env = context.fetch(:rails_env, nil) | |
hipchat_token = context.fetch(:hipchat_token, nil) | |
hipchat_room_name = context.fetch(:hipchat_room_name, nil) | |
client = HipChat::Client.new(hipchat_token, {}) |
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
before :deploy do | |
# Get the topmost migration that has been run: | |
run "rake db:current_version > migration_version.txt" | |
end | |
after 'deploy:rollback' do | |
run "rake db:migrate VERSION=`cat migration_version.txt`" | |
end | |
after :deploy 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
### Keybase proof | |
I hereby claim: | |
* I am kcdragon on github. | |
* I am kcdragon (https://keybase.io/kcdragon) on keybase. | |
* I have a public key whose fingerprint is 9BCD 0964 3B79 0BAA 2A47 20DA C4E9 439D 4D72 483A | |
To claim this, I am signing this object: |
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
# only tested on development machine | |
curl "localhost:9200/_cluster/health?level=indices&pretty=true" | grep -B 1 '"status" : "red"' | grep "{" | cut -d"\"" -f2 | while read -r line ; do curl -XDELETE localhost:9200/$line && echo; done |
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 'pp' | |
by_ip = {} | |
DATA.each_line do |line| | |
request = line.split(' ') | |
url = request[1] + ' ' + request[2].gsub('"', '') | |
ip = request[4] | |
by_ip[ip] ||= [] |
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 'elasticsearch' | |
require 'pp' | |
require 'hashie' | |
@count = 1 | |
INDEX = 'didyoumean-test' | |
TYPE = 'test' | |
CLIENT = Elasticsearch::Client.new(log: true, send_get_body_as: 'POST') |
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
guard :minitest, test_folders: '.' do | |
# with Minitest::Unit | |
watch(%r{^(.+)_test\.rb}) { |m| "./#{m[1]}_test.rb" } | |
watch(%r{^(.+)\.rb}) { |m| "./#{m[1]}_test.rb" } | |
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
find src/ -type f -exec sed -i '' 's/foo/bar/g' {} + |
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
@ECHO OFF | |
IF NOT "%~f0" == "~f0" GOTO :WinNT | |
@"C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe" "C:/RailsInstaller/Ruby2.2.0/bin/bundle" %1 %2 %3 %4 %5 %6 %7 %8 %9 | |
GOTO :EOF | |
:WinNT | |
@"C:\RailsInstaller\Ruby2.2.0\bin\ruby.exe" "%~dpn0" %* |
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
http://recordit.co/ | |
http://beyondgrep.com/install/ | |
https://itunes.apple.com/us/app/status-clock/id552792489?mt=12 |
OlderNewer