Skip to content

Instantly share code, notes, and snippets.

View pdx91's full-sized avatar
:shipit:
shipit

PD pdx91

:shipit:
shipit
View GitHub Profile
@pdx91
pdx91 / balance_history_preservation.rb
Last active March 31, 2024 00:03
BalanceHistory::Preservation
# This class in pulled from https://balance.day for my 37signals application.
class BalanceHistory::Preservation
InvalidData = Class.new(StandardError)
attr_reader :account
def initialize(account)
@account = account
end
@pdx91
pdx91 / sync.rb
Created September 28, 2023 18:00
Sync jobs with Healthchecks.io
module Balance
module Monitor
module Uptime
module Sync
def self.now!
sync_new_jobs
remove_unused_jobs
end
def self.sync_new_jobs
if Rails.env.development?
ENV["BASE_URL"] = `curl -s http://localhost:4040/api/tunnels/ | jq -r '.tunnels' | jq -r '.[0].public_url' | awk -F/ '{print $3}' | tr -d '\n'`
Rails.application.config.hosts << ENV["BASE_URL"]
Rails.application.config.action_mailer.default_url_options = {
host: ENV["BASE_URL"]
}
end
@pdx91
pdx91 / tmux.md
Created August 15, 2016 04:48 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@pdx91
pdx91 / capybara cheat sheet
Created October 8, 2015 22:39 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')