Skip to content

Instantly share code, notes, and snippets.

✂️
Cutting red diffs

Samuel Cochran sj26

✂️
Cutting red diffs
Block or report user

Report or block sj26

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sj26
sj26 / style.css
Last active Feb 11, 2020 — forked from guilherme-teodoro/style.css
[Stylus] Basecamp 3 - Dark mode
View style.css
@media (prefers-color-scheme: dark) {
body {
background: #191919;
color: white;
}
h1 {
color: white;
}
@sj26
sj26 / com.sj26.TerminalAppearanceThemeChanger.plist
Last active Jan 29, 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" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.sj26.TerminalAppearanceThemeChanger</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
@sj26
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);
});
View pipeline.sh
#!/bin/bash
set -euo pipefail
echo "running script"
buildkite-agent pipeline upload <<YAML
- trigger: triggered-with-metadata
label: ":rocket:"
branches: "master"
async: true
View artifact.json.diff
{
"id": "76365070-34d5-4104-8b91-952780f8029f",
"job_id": "aae578fe-994c-44e6-84da-4102616928ba",
"url": "https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds/1/jobs/aae578fe-994c-44e6-84da-4102616928ba/artifacts/76365070-34d5-4104-8b91-952780f8029f",
"download_url": "https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds/1/jobs/aae578fe-994c-44e6-84da-4102616928ba/artifacts/76365070-34d5-4104-8b91-952780f8029f/download",
"state": "finished",
"path": "dist/app.tar.gz",
"dirname": "dist",
"filename": "app.tar.gz",
"mime_type": "application/x-gzip",
View artifact.json
{
"id": "76365070-34d5-4104-8b91-952780f8029f",
"job_id": "aae578fe-994c-44e6-84da-4102616928ba",
"url": "https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds/1/jobs/aae578fe-994c-44e6-84da-4102616928ba/artifacts/76365070-34d5-4104-8b91-952780f8029f",
"download_url": "https://api.buildkite.com/v2/organizations/my-great-org/pipelines/my-pipeline/builds/1/jobs/aae578fe-994c-44e6-84da-4102616928ba/artifacts/76365070-34d5-4104-8b91-952780f8029f/download",
"state": "finished",
"path": "dist/app.tar.gz",
"dirname": "dist",
"filename": "app.tar.gz",
"mime_type": "application/x-gzip",
@sj26
sj26 / Dockerfile
Last active Mar 5, 2019
Docker file cache test
View Dockerfile
FROM ruby
WORKDIR /app
COPY Gemfile Gemfile.lock ./
RUN bundle --deployment
RUN bundle show rack
View docker-compose.yml
version: "3.6"
services:
app:
build: ..
depends_on:
- selenium
environment:
SELENIUM_HOST: selenium
@sj26
sj26 / brew-mirror-artifacts.rb
Created Nov 19, 2018
Setup a mirror to use with $HOMEBREW_ARTIFACT_DOMAIN
View brew-mirror-artifacts.rb
# Homebrew has $HOMEBREW_ARTIFACT_DOMAIN which allows using a mirror for downloads:
#
# https://docs.brew.sh/Manpage#environment
#
# But no easy way to create such a mirror. This command which creates a mirror from
# all core formulae downloads. Pop it in /usr/local/Homebrew/Library/Homebrew/cmd/
# with a `chmod +x` and run `brew mirror-artifacts`.
require "formula"
View build-packer-templates.rb
def link_to(url, content = nil)
if ENV["BUILDKITE"]
"\e]1339;url=#{url.gsub(";", "%3b")}#{";content=#{content.gsub(";", "%3b")}" if content}\a"
else
url
end
end
def system!(*args)
system(*args) or fail("Command exited with status #{$?.exitstatus}: #{args.join(" ")}")
You can’t perform that action at this time.