Skip to content

Instantly share code, notes, and snippets.


Samuel Cochran sj26

View GitHub Profile
View rspec
set -euo pipefail
echo -e "--- :database: Preparing databases"
bin/rake db:test:prepare db:job_log_chunks:reset
echo -e "+++ :rspec: Running \033[33mspecs\033[0m :cow::bell:"
sj26 / basecamp-pull-to-refresh.user.js
Last active Jun 10, 2021
I use the heystack page as the root of my basecamp tab, and often want to read notifications then go back to the heystack with a trackpad swipe, but then the heystack contents is outdated because turblinks restores the previous contents. So this lets me stay on the trackpad and do a pull-to-refresh to update the notifications. Ideally it would r…
View basecamp-pull-to-refresh.user.js
// ==UserScript==
// @name basecamp-pull-to-refresh
// @description Pull to refresh the Basecamp 3 Heystack page.
// @author Samuel Cochran <>
// @license MIT
// @version 1
// @match*/my/readings
// @run-at document-end
// @homepage
// ==/UserScript==
sj26 / active_record_timescale_extensions.rb
Last active Jun 4, 2021
Timescale extensions for ActiveRecord
View active_record_timescale_extensions.rb
# Put this in config/initializers/
module ActiveRecord::Tasks::TimescaleExtensions
def structure_load(filename, extra_flags)
# If this structure is using timescaledb then we need to take some extra steps
if system "grep", "-Eq", "CREATE EXTENSION( IF NOT EXISTS)? timescaledb", filename
puts "Enabling timescale extension"
sj26 / basecamp-show-tweet-cards.user.js
Last active Sep 8, 2020
Show cards in embedded tweets in campfires etc so you can see the images etc that are being shared
View basecamp-show-tweet-cards.user.js
// ==UserScript==
// @name basecamp-show-tweet-cards
// @description Show cards in embedded tweets so you can see the images etc that your friends are sharing
// @author Samuel Cochran <>
// @license MIT
// @version 1
// @match*/embeds/*/chat
// @run-at document-end
// @homepage
// @updateURL
sj26 / basecamp-more-hotkeys.user.js
Last active Sep 1, 2020
Some more hotkeys for Basecamp keyboard warriors
View basecamp-more-hotkeys.user.js
// ==UserScript==
// @name basecamp-more-hotkeys
// @description Some more hotkeys for Basecamp keyboard warriors
// @author Samuel Cochran <>
// @license MIT
// @version 1.2
// @match*
// @homepage
// @updateURL
// ==/UserScript==
View Dockerfile
# syntax = docker/dockerfile:experimental
FROM ruby:2.6.5 AS base
ADD /etc/apt/trusted.gpg.d/pgdg.asc
ADD /etc/apt/trusted.gpg.d/nodesource.asc
ADD /etc/apt/trusted.gpg.d/yarn.asc
RUN --mount=type=cache,target=/var/cache/apt \
--mount=type=cache,target=/var/lib/apt \
sj26 / buildkite-release-stable.yml
Last active Aug 21, 2020
Buildkite pipeline sometimes-unblock
View buildkite-release-stable.yml
- command: echo release stable
sj26 / .gitignore
Last active Nov 12, 2020 — forked from guilherme-teodoro/style.css
Basecamp 3 - Dark mode
View .gitignore
sj26 / com.sj26.TerminalAppearanceThemeChanger.plist
Last active Apr 20, 2020
Apple Terminal Default Window Settings Changer
View com.sj26.TerminalAppearanceThemeChanger.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
sj26 / fastmail-auto-dark.user.js
Created Jan 28, 2020
Fastmail Auto Dark Mode
View fastmail-auto-dark.user.js
// I don't know how to inject this on load yet, but pasting this in a console makes the Fastmail theme change between light and dark when macOS is toggled between light and dark.
window.matchMedia("(prefers-color-scheme: dark)").addListener(function(query) {
var theme = query.matches ? "dark" : "minimal";
FastMail.theme.set("theme", theme);
FastMail.userPrefs.set("theme", theme);