🤹♂️
View aws_s3_uri.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "uri" | |
# Parses an S3 URI for region, bucket and key | |
# | |
# Based on the java sdk: | |
# | |
# https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/AmazonS3URI.java | |
# | |
# Reference: | |
# |
View buildkite-automatic-sso.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name buildkite-automatic-sso | |
// @description I'm tired of clicking SSO buttons on buildkite.com | |
// @match https://buildkite.com/* | |
// @run-at document-idle | |
// ==/UserScript== | |
if (document.title.match(/^Authorization Required:/)) { | |
document.querySelector("input[type=submit][value^='Sign in to your'], input[type=submit][value^='Continue with']").click(); | |
} |
View slack-hide-install-alert.user.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ==UserStyle== | |
@name slack-hide-install-alert | |
@description No, really, I don't want it. | |
@match https://app.slack.com/* | |
==/UserStyle== */ | |
.p-workspace_banner__desktop-download-app { | |
display: none !important; | |
} |
View timcopter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TIM:TIM:TIM:TIM:TIM:TIM | |
_^___ | |
T __/ [] \ | |
TIM===__ \ | |
M \________] | |
I I | |
--------/ |
View slack-archive-redirect.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name slack-archive-redirect | |
// @namespace https://sj26.com/slack-archive-redirect | |
// @version 1 | |
// @description Open slack in the browser straight away | |
// @author sj26@sj26.com | |
// @match https://*.slack.com/archives/* | |
// @grant none | |
// ==/UserScript== |
View activerecord-lifetime.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# Connection lifetime for ActiveRecord | |
# | |
# Make sure that connections to the database can only live for a certain number | |
# of seconds. Once lifetime is reached, the underlying connection will be | |
# reconnected. This is enforced when checking out a connection for use from the | |
# pool. Use in combination with idle_timeout to enforce connection lifetime on | |
# idle connections as well. | |
# |
View rspec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
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:" |
View basecamp-pull-to-refresh.user.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name basecamp-pull-to-refresh | |
// @description Pull to refresh the Basecamp 3 Heystack page. | |
// @author Samuel Cochran <sj26@sj26.com> | |
// @license MIT | |
// @version 1 | |
// @match https://3.basecamp.com/*/my/readings | |
// @run-at document-end | |
// @homepage https://gist.github.com/sj26/0c04accaaf2ec83b2deb79425f8046ca | |
// ==/UserScript== |
View active_record_timescale_extensions.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# https://docs.timescale.com/timescaledb/latest/how-to-guides/backup-and-restore/pg-dump-and-restore#entire-database | |
if system "grep", "-Eq", "CREATE EXTENSION( IF NOT EXISTS)? timescaledb", filename | |
puts "Enabling timescale extension" | |
connection.enable_extension("timescaledb") |
NewerOlder