Skip to content

Instantly share code, notes, and snippets.

View robatron's full-sized avatar
🤖

Rob McGuire robatron

🤖
  • Zillow
  • Seattle, WA
View GitHub Profile
@robatron
robatron / strava-quick-manual-entry.user.js
Last active September 13, 2023 17:22
Strava Quick Manual Entry (Tampermonkey)
// ==UserScript==
// @name Strava Quick Manual Entry
// @version 0.1.1
// @description Adds an input box to the manual entry page allowing for quick entry of an activity
// @author robert.mcgui@gmail.com
// @match https://www.strava.com/upload/manual
// @icon https://d3nn82uaxijpm6.cloudfront.net/favicon-32x32.png
// @grant none
// @sandbox JavaScript
// @downloadURL https://gist.githubusercontent.com/robatron/5590620a5346715062301ebc0af0ed65/raw/sqme.user.js
@robatron
robatron / slack-message-tweaks.user.js
Last active August 10, 2023 07:38
Slack Message Tweaks (Tampermonkey)
// ==UserScript==
// @name Slack Message Tweaks
// @version 0.0.2
// @description Add absolute timestamps to messages, and swap app links for web links
// @author robert.mcgui@gmail.com
// @match https://app.slack.com/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @sandbox JavaScript
// @downloadURL https://gist.githubusercontent.com/robatron/0e4fcda19f77b1b6471ea72cda96ca89/raw/slack-message-tweaks.user.js
@robatron
robatron / hot-spiked-mulled-apple-cider.md
Created October 21, 2020 18:33
Hot Spiked Mulled Apple Cider Slow Cooker Recipe

Ingredients

  • 1 gallon unfiltered apple juice or apple cider
  • 1 large orange, cut into slices
  • Small ginger root, peeled, cut into ~1" cubes
  • 3-4 cinnamon sticks
  • 4 star anise
  • 1 tablespoon whole cloves
  • 1 tablespoon whole allspice
  • (Optional) 21 oz (621 ml) bourbon or rum. Assuming 16 oz of juice is removed per directions below, this will yield about "1 shot" (1.5 oz) of alcohol per 8 oz of drink.
@robatron
robatron / making-a-timelapse.md
Last active December 17, 2023 10:40
Making a Timelapse Video with a GoPro and a MacBook

Making a Timelapse Video with a GoPro and a MacBook

Here are some details about how I made this timelapse video with a GoPro and a Mac. It wasn't as straight-forward as I thought it would be, so I wanted to share what I learned.

As you can see from the video, the subject was me building a wooden mechanical 3D puzzle which took me nearly 18 hours to build. I took a photo once every 5 seconds which yeilded more than 12.7k photos.

Ingredients

Here's what I used to make a timelapse video.

#!/bin/bash
# Remote script to install these dotfiles on a system
system_type=$(uname -s)
repo_url="https://robatron@bitbucket.org/robatron/dotfiles.git"
echo "Verifying git installed..."
if ! [ -x "$(command -v git)" ]; then
seta r_mode "-1"
seta r_customwidth "1920"
seta r_customheight "1080"
r_swapInterval "1"
/**
* Represents a hash table implemented on top of an array where each bucket is
* also an array.
*/
class HashTable {
// Create a new hash table instantiated with the table size, the size of
// the the array
constructor(tableSize) {}
@robatron
robatron / node.js
Last active February 29, 2016 18:10
class Node {
constructor( value = null, adjacents = [] ) {
this.value = value;
this.adjacents = adjacents;
}
toString ( ) {
return JSON.stringify( this );
}
}
If you want to achieve greatness stop asking for permission. ~Anonymous
Things work out best for those who make the best of how things work out. ~John Wooden
To live a creative life, we must lose our fear of being wrong. ~Anonymous
If you are not willing to risk the usual you will have to settle for the ordinary. ~Jim Rohn
Trust because you are willing to accept the risk, not because it's safe or certain. ~Anonymous
Take up one idea. Make that one idea your life - think of it, dream of it, live on that idea. Let the brain, muscles, nerves, every part of your body, be full of that idea, and just leave every other idea alone. This is the way to success. ~Swami Vivekananda
All our dreams can come true if we have the courage to pursue them. ~Walt Disney
Good things come to people who wait, but better things come to those who go out and get them. ~Anonymous
If you do what you always did, you will get what you always got. ~Anonymous
Success is walking from failure to failure with no loss of enthusiasm. ~Winston Chu

Automatically Prepend a Jira Issue ID to Git Commit Messages

Use a git hook to match a Jira issue ID from the current branch, and prepend it to every commit message

Assuming the current branch contains a Jira issue ID, you can use a git hook script to prepend it to every commit message.

  1. Create an empty commit-msg git hook file, and make it executable. From your project's root directory:

     install -b -m 755 /dev/null .git/hooks/commit-msg
    
  2. Save the following script to the newly-created .git/hooks/commit-msg file: