As configured in my dotfiles.
start new:
tmux
start new with session name:
require "httpx" | |
module Clientable | |
extend ActiveSupport::Concern | |
def initialize | |
@httpx = HTTPX | |
.plugin(:retries, retry_change_requests: true) | |
.max_retries(3) | |
end |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# frozen_string_literal: true | |
module Authentication | |
# Rodauth is pretty coupled to being in a request context, but this will provide the minimum necessary to be able | |
# to generate correct URLs | |
def self.rodauth(configuration_name = :user, params: {}) | |
url_options = Rails.application.config.action_mailer.default_url_options | |
host = url_options[:host] | |
host += ":#{url_options[:port]}" if url_options.key?(:port) | |
base_url = "#{url_options[:protocol] || 'http'}://#{host}" |
require 'rodauth' | |
module Rodauth | |
# Clean up how we configure all of our tables, columns, etc., to use values which are more consistent with Rails than | |
# the defaults as well as use Rails mailers | |
Feature.define(:rails_conventions, :RailsConventions) do | |
depends :rails # rodauth-rails feature | |
def post_configure | |
# Rodauth uses dash-separated paths by default, so we'll make these underscores by default |
# frozen_string_literal: true | |
require 'rodauth' | |
# In order for Rails to reload this constant in dev, we need `require_dependency` because Rodauth expects the features | |
# in a specific load path, but it defines a constant against Rails' expectations, which breaks reloading. | |
require_dependency 'rodauth/features/remote_ip' | |
module Rodauth | |
Feature.define(:migrate_from_devise, :MigrateFromDevise) do |
#!/bin/sh | |
isp=$(dig +noall +stats 2>&1 | awk '$2~/^SERVER:$/{split($3,dnsip,"#");print dnsip[1]}'); | |
m="-------------------------------------------------------------------------------"; | |
s=" "; | |
h="+${m:0:25}+${m:0:12}+${m:0:12}+${m:0:12}+${m:0:12}+${m:0:12}+"; | |
header=("Domain${s:0:23}" "Your ISP${s:0:10}" "Google${s:0:10}" "4.2.2.2${s:0:10}" "OpenDNS${s:0:10}" "DNS Adv.${s:0:10}"); | |
echo "${h}"; | |
echo "| ${header[0]:0:23} | ${header[1]:0:10} | ${header[2]:0:10} | ${header[3]:0:10} | ${header[4]:0:10} | ${header[5]:0:10} |"; | |
echo "${h}"; | |
for i in "lifehacker.com" "facebook.com" "manu-j.com" "reddit.com" "tb4.fr" "bbc.co.uk"; |
I hereby claim:
To claim this, I am signing this object:
echo "Flipping tables! (╯°□°)╯︵ ┻━┻" | |
num_rules=3 | |
real=3 # exposed to the ELB as port 443 | |
test=4 # used to install test certs for domain verification | |
health=5 # used by the ELB healthcheck | |
blue_prefix=855 | |
green_prefix=866 |
module Capybara::Poltergeist | |
class Client | |
private | |
def redirect_stdout | |
prev = STDOUT.dup | |
prev.autoclose = false | |
$stdout = @write_io | |
STDOUT.reopen(@write_io) | |
prev = STDERR.dup |
module Capybara::Poltergeist | |
class Client | |
private | |
def redirect_stdout(to) | |
prev = STDOUT.dup | |
prev.autoclose = false | |
$stdout = to | |
STDOUT.reopen(to) | |
prev = STDERR.dup |