Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ianchesal
ianchesal / breathalyzer
Last active August 29, 2015 14:01
breathalyzer -- Run Rubocop on Changed Files in a Git-Managed Directory
#!/usr/bin/env ruby
##
# Runs rubocop on just the modified and new files in a repoistory. Handy for
# checking your compliance before you commit. It only runs against files that
# end in .rb. Maybe it should do more than that?
#
# Easy to run. In a dirty working directory:
#
# breathalyzer
@ianchesal
ianchesal / .rubocop.yml
Created May 18, 2014 00:20
My ~/.rubocop.yml file
########
# My ~/.rubocop.yml file
#
# Rubocop: https://github.com/bbatsov/rubocop#installation
MethodLength:
Enabled: false
LineLength:
Max: 160
@ianchesal
ianchesal / terminal_fonts.md
Created September 3, 2014 18:18
Terminal Fonts

Like Menlo but it has a dotted zero a slightly nicer kerning and spacing. Menlo refined if you like.

@ianchesal
ianchesal / gist:3316a7fd5466e01871e6
Created September 16, 2014 17:10
Debugging 1Password extension problem with browser signature verification
○ → codesign -dvvv /Applications/Google\ Chrome.app
Executable=/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
Identifier=com.google.Chrome
Format=bundle with Mach-O thin (i386)
CodeDirectory v=20100 size=186 flags=0x0(none) hashes=3+3 location=embedded
Hash type=sha1 size=20
CDHash=a8d3a44cc2a7957e8d9cd9c6f6eb9124a7e4a9fd
Signature size=8507
Authority=Developer ID Application: Google Inc.
Authority=Developer ID Certification Authority
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
@ianchesal
ianchesal / brew_list_versions.txt
Created July 26, 2019 06:38
Currently installed brew packages
❯ brew list --versions
adns 1.5.1
aom 1.0.0
autoconf 2.69
awscli 1.16.200
bash-completion 1.3_3
bat 0.11.0_1
cairo 1.16.0_2
exiftool 11.57
ffmpeg HEAD-2d900d8_1
@ianchesal
ianchesal / bitbucket2github.sh
Created July 17, 2020 21:38
Convert a bitbucket repository to a github repository
#!/bin/sh
# Usage:
#
# cd ~/src/some-bitbucket-repo
# ~/bin/bitbucket2github.sh
#
# The script assumes the name of the directory is the name
# of the repository that you want to use on github.com.
@ianchesal
ianchesal / fractal-bot-backup-organizer
Last active June 17, 2022 00:51
Auto-Organize Your Fractal-Bot Backups
#!/usr/bin/env ruby
# ***USE***
# Drop this file into the folder where you have Fractal-Bot storing your
# backups. Name it whatever you like. Run it from time to time and it'll
# sort your backups into sub-folders based on file prefixes.
#
# If you're on a Mac you can use this code as a Folder Automation action and
# it should work just fine and run every time a new file is created in your
# backup folder.
@ianchesal
ianchesal / fargate-content.bash
Created June 30, 2021 19:04
List fargate content in ECS clusters
#!/bin/bash
# Returns the count of Fargate content in each ECS cluster in your account+region.
aws ecs list-clusters 2>/dev/null | jq -c '.clusterArns[]' | while read cluster; do
cluster="${cluster%\"}"
cluster="${cluster#\"}"
cname=$(basename $cluster)
echo "Checking: $cname"
aws ecs list-services --cluster $cname --launch-type FARGATE 2>/dev/null | jq '.serviceArns | length'
@ianchesal
ianchesal / README.md
Last active August 13, 2023 13:50
Migrating NightScout site from Heroku to Render.com

Migrating NightScout from Heroku to Render.com

!!!! Attention !!!!

These are mostly my rough notes on the process I followed to migrate my NightScout site from Heroku to Render.

They have not been rigorously tested or attempted more than the one time I migrated.

I'm using NightScout with a Dexcom setup. I have no idea if these instructions will work for any other CGM setup.