Skip to content

Instantly share code, notes, and snippets.

@betesh
betesh / Chrome 61 Backup Saved Passwords
Last active December 14, 2017 15:19 — forked from MoradiDavijani/Chrome 61 Backup Saved Passwords
As Chrome removed the "Backup" button in "Saved Passwords", you can make a backup from your passwords by running this code in the console!
// 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) {
@betesh
betesh / application.rb
Created April 11, 2018 20:54
Logging Initializers in Rails 3.2
# 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
@betesh
betesh / .gitignore
Last active January 8, 2020 04:01
Flattening
Gemfile.lock
examples.txt
@betesh
betesh / .gitignore
Last active October 22, 2020 20:31 — forked from sh4dowb/retrieve_password.py
Chromium Linux Password Retriever (Decryption support)
We couldn’t find that file to show.
@betesh
betesh / vcr-webmock-2-converter.rb
Created November 3, 2020 01:58
webmock-vcr-cassette-upgrader
#!/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'
@betesh
betesh / Gemfile
Last active September 18, 2022 04:15
how to append a has_many association without hitting the database immediately
source 'https://rubygems.org'
gem 'activerecord', '~> 3.2.18'
gem 'sqlite3', '= 1.3.5'
gem 'rspec'