Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Lindsay tlindsay

View GitHub Profile
@tlindsay
tlindsay / pick-branch.sh
Last active Feb 6, 2020
Choose a branch from an fzf list
View pick-branch.sh
git branch -lv | fzf | awk '{print $1}' | xargs git checkout
@tlindsay
tlindsay / pick-pr.sh
Created Feb 4, 2020
Choose open PR from a list and checkout
View pick-pr.sh
hub pr list | fzf | awk '{print $1}' | sed 's/\#//' | xargs hub pr checkout
View components.my-foo.js
import Ember from 'ember';
export default Ember.Component.extend({
bar: null,
valAtInit: null,
valAtDRA: null,
init() {
this._super(...arguments);
console.log('init', this.bar);
@tlindsay
tlindsay / wipcheck.sh
Last active Jul 26, 2018
WIP Check Pre-commit Hook
View wipcheck.sh
#!/bin/sh
#
# This pre-commit hook will prevent you from continuing your work without resolving WIP commits
# It expects WIP commits to have the message `--wip-- [skip ci]`
#
# You can use the following commands to easily create and restore WIP commits:
# gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip-- [skip ci]"'
# gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1'
#
# To enable this hook, rename this file to "pre-commit".
@tlindsay
tlindsay / Spotify-now-playing-on-TouchBar.scpt
Created Jun 23, 2017 — forked from LucaTNT/Spotify-now-playing-on-TouchBar.scpt
This script can be used in conjunction with Better Touch Tool to display the currently playing track in Spotify on the MacBook Pro TouchBar. More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
View Spotify-now-playing-on-TouchBar.scpt
-- This script can be used in conjunction with Better Touch Tool to display the currently playing track on the MacBook Pro TouchBar
-- More info here: https://lucatnt.com/2017/02/display-the-currently-playing-track-in-itunesspotify-on-the-touch-bar
if application "Spotify" is running then
tell application "Spotify"
if player state is playing then
return (get artist of current track) & " - " & (get name of current track)
else
return ""
end if
@tlindsay
tlindsay / svg.html
Created Jun 9, 2017
Horizontally and Vertically Center SVGs
View svg.html
<style>
.wrapper {
position: relative;
svg {
bottom: 50%;
left: 50%;
position: absolute;
right: 50%;
top: 50%;
View keybase.md

Keybase proof

I hereby claim:

  • I am tlindsay on github.
  • I am thatdarnpat (https://keybase.io/thatdarnpat) on keybase.
  • I have a public key ASCi2y_1tqE5sn4oEkO_lVWJBckF_qE1JWnZ6shLZGEEsAo

To claim this, I am signing this object:

View limitLoop.js
/*
limitLoop.js - limit the frame-rate when using requestAnimation frame
Released under an MIT license.
When to use it?
----------------
A consistent frame-rate can be better than a janky experience only
occasionally hitting 60fps. Use this trick to target a specific frame-
rate (e.g 30fps, 48fps) until browsers better tackle this problem
View osx-10.10-setup.md

Mac OS X 10.10 Yosemite

Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

Install Software

@tlindsay
tlindsay / ARM Install Node
Last active Aug 29, 2015
Quick snippet for installing Node on ARM devices.
View ARM Install Node
# Credit to Pieter Beulque
# http://weworkweplay.com/play/raspberry-pi-nodejs/
####################################################
wget http://node-arm.herokuapp.com/node_latest_armhf.deb;
sudo dpkg -i node_latest_armhf.deb;
node --version
You can’t perform that action at this time.