Skip to content

Instantly share code, notes, and snippets.

View puts_here.rb
# frozen_string_literal: true
# rubocop:disable
def puts_here(symbol: "*")
puts symbol + caller(1..1).first + symbol * 50
if block_given?
puts symbol + caller(1..1).first + symbol * 50
rob-murray /
Created Apr 14, 2020
ASDF - Install Ruby with SSL
RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" asdf install ruby 2.6.5
rob-murray / UK Company Number regex
Last active Jan 26, 2022
A regex to check UK Company numbers - ie the reference assigned to companies in the UK via Companies House
View UK Company Number regex
View rails new skip
rails new app_name \
--database=postgresql \
--skip-action-cable --skip-action-mailer --skip-active-storage \
--skip-sprockets --skip-action-mailbox --skip-action-text \
--skip-bundle --skip-keeps --skip-spring --skip-test \
--skip-coffee --skip-system-test --skip-turbolinks
docker run -d \
--name pihole \
-p 53:53/tcp -p 53:53/udp \
-p 80:80 \
-p 443:443 \
-e TZ="Europe/London" \
View fix macos default icons
sudo rm -rfv /Library/Caches/; sudo find /private/var/folders/ \( -name -or -name \) -exec rm -rfv {} \; ; sleep 3; killall Dock; killall Finder
rob-murray /
Created Jun 29, 2018
Script to dismiss "Chrome did not shut down properly" when running in kiosk mode on Raspberry Pi
# Wait for a bit and then click in the top right of the screen to turn off the "chrome did not shut down properly" popup.
sleep 10
export DISPLAY=":0"
xdotool mousemove 1905 20 # change co-ords to suit
xdotool click 1
rob-murray / lendingbot.service
Created May 31, 2018
Run BitBotFactory MikaLendingBot as systemd service on Raspberry Pi
View lendingbot.service
Description=LendingBot service
ExecStart=/usr/bin/python <CODE_DIR>/
rob-murray / pg_enums.sql
Last active May 31, 2018
PG list enums
View pg_enums.sql
select n.nspname as enum_schema,
t.typname as enum_name,
string_agg(e.enumlabel, ', ') as enum_values
from pg_type t
join pg_enum e on t.oid = e.enumtypid
join pg_catalog.pg_namespace n ON n.oid = t.typnamespace
group by n.nspname, t.typname
order by enum_name;