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
#!/usr/bin/env ruby | |
# | |
# Convert VCR cassettes that use basic auth to work with Webmock 2. Takes the folder where the VCR | |
#cassettes are stored as an argument. | |
require 'yaml' | |
require 'base64' | |
require 'uri' | |
require 'vcr' |
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
Gemfile.lock | |
examples.txt |
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
# Put this in config/application.rb right before your Application class | |
class Rails::Initializable::Initializer | |
def run_with_logging(*args) | |
app = args.first | |
app.config.logger.warn "Running initializer #{name}\t(#{@context.class.parent})" | |
run_without_logging(*args) | |
end | |
alias_method_chain :run, :logging | |
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
// 1. Open chrome://settings/passwords | |
// 2. Open chrome developer tools (using F12 or Ctrl+Shift+i) | |
// 3. Run the following code in the console tab | |
// 4. Copy output in a text file and save it somewhere safe! | |
function asyncForEach(array, done, iterator) { | |
var i = 0; | |
next(); | |
function next(err) { | |
if (err) { |
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
# /usr/bin/env ruby | |
PAIRS = [ | |
["SHA1_ON_NEW_BRANCH", "SHA1_ON_ORIGINAL_BRANCH"], | |
# etc... | |
] | |
PAIRS.each do |pair| | |
cmd = "bash -c 'diff <(git show #{pair[0]} -U0 --format=\"\" | grep -v \"^index\") <(git show #{pair[1]} -U0 --format=\"\" | grep -v \"^index\") | grep -v \"> @@ \" | grep -v \"< @@ \" | grep -v \"^---$\" '" | |
result = `#{cmd}`.chomp |
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
/* Adapted from https://cmatskas.com/export-your-stored-passwords-from-chrome/ | |
* 1. Go to chrome://settings-frame/passwords | |
* 2. Paste the following into the JS console: | |
*/ | |
var decryptedRow=""; | |
var pm = PasswordManager.getInstance(); | |
var model = pm.savedPasswordsList_.dataModel; | |
var pl = pm.savedPasswordsList_; | |
for(i=0;i<model.length;i++){ |
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
# Dequeueing ActiveJob tasks in the context of your Rails application? | |
# An alternative is to run a standalone ActiveJob process. | |
# But making it dequeue and send devise emails isn't so simple. | |
# Devise is designed to be integrated into a Rails application, not a standalone ActiveJob process. | |
# Before we address configuring the standalone ActiveJob process, | |
# there's some code that needs to go into your Rails app. | |
# Put this in each model in your Rails application: | |
# |
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
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' |
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
source 'https://rubygems.org' | |
gem "activerecord", "~> 4.2" | |
gem "sqlite3" | |
gem "rspec" |
NewerOlder