Skip to content

Instantly share code, notes, and snippets.

@Capncavedan
Capncavedan / sample.rb
Created April 25, 2024 16:15
Removing orphaned sidekiq-unique-jobs digests
> SidekiqUniqueJobs::LockDigest.new({
'class' => 'SidekiqQueuesMetricsWorker',
'queue' => 'system_critical',
'lock_args' => [],
}).lock_digest
# => ":c9e4f70a93ec7b29f57842219285f439"
> r = Redis.new
# => #<Redis client v4.8.1 for redis://hostname....
@Capncavedan
Capncavedan / find.sql
Created March 27, 2018 16:06
Find corrupt/invalid Postgresql indexes
SELECT pg_class.relname
FROM pg_class, pg_index
WHERE pg_index.indisvalid = false
AND pg_index.indexrelid = pg_class.oid;
Ruby and Ruby and Rails still feel fresh and new to me, but (surprise!) Ruby is over 20 years old, and Rails is nearly 12.
A lot's happened in the ecosystem over time, practices have changed, gems have shot up the charts and later fallen out of favor, and new programming techniques have come on the scene.
Keeping up with this can be a challenge, especially for those working on long-term projects and/or on stable teams with few newcomers: how do you get your job done and ship a product while also continually refining your skills and learning about new solutions & professional best practices?
You know there are twitterers, podcasts, courses, books, and even blogs (yes, people still do those!) - but how do you find them, and which are worthwhile to invest your time and money in?
Let's pool our knowledge and share!
@Capncavedan
Capncavedan / TI list.txt
Created March 16, 2017 17:05
Trans Iowa packing list from 2016
Rain gear
-----------
rain jacket, w/bag
rubberized gloves
shower cap?
in dry bags:
extra jersey
extra undershirt?
extra shorts
extra socks
Great panniers: http://www.arkel-od.com
Great fenders and headlights: http://planetbike.com/page/
Great taillight: https://www.ridepdw.com/goods/lights/danger-zone-usb
@Capncavedan
Capncavedan / gist:2d6e62a287007aef5b32
Created July 7, 2015 21:07
moving columns in a table in postgres
this guide: https://wiki.postgresql.org/wiki/Alter_column_position#Add_columns_and_move_data
alter table financial_statements add column new_years_in_business integer, add column new_other_net_worth integer;
update financial_statements set new_years_in_business = years_in_business;
update financial_statements set new_other_net_worth = other_net_worth;
alter table financial_statements drop column years_in_business cascade, drop column other_net_worth cascade;
@Capncavedan
Capncavedan / gist:b20b9f8c94c930614428
Created March 21, 2015 01:27
Rough route notes for 150 mile gravel escapade
105th St
L on Vintage
R on 120th
L on Upland
BR on 133rd Ct
R on Kimber Ridge Ave
L on 105th
L on Badger Creek
R on 140th
R on R16 / Quail Ridge
@Capncavedan
Capncavedan / gist:8de9b103bc18f9999d41
Last active August 29, 2015 14:11
Hub order process vision
----------------------------------------------------------------------
Goals
----------------------------------------------------------------------
Few steps as possible to “done” & downloadable PDF
Fast! (webpage steps specifically)
Tools to prevent errors:
live previews
@Capncavedan
Capncavedan / gist:5f579091447da03f0b90
Created July 3, 2014 19:49
Transaction codes for Texas bonds
transaction codes for Texas
For Texas:
1 = CANCEL - Insured's option
2 = CANCEL – Non-payment of premium
3 = CANCEL - Company option
4 = Other (miscellaneous adjustments)
5 = Endorsements
6 = Audit premiums
7 = Reinstatements
@Capncavedan
Capncavedan / info.md
Last active August 29, 2015 13:56
Speed up your Ruby Travis CI build with this one weird old trick ...

OK, it's two weird old tricks.

First, use their bundle caching feature. It's one line added to your .travis.yml file, and significantly speeds up test runs where you haven't changed your gem bundle - which is most of the time for most people.

See more here: http://blog.travis-ci.com/2013-12-05-speed-up-your-builds-cache-your-dependencies/

Second, do some experimentation with your Ruby garbage collection settings to speed up your local test suite runs. Examples from our development environment: