Skip to content

Instantly share code, notes, and snippets.

View tlindsay's full-sized avatar

Patrick Lindsay tlindsay

View GitHub Profile
@tlindsay
tlindsay / ARM Install Node
Last active August 29, 2015 14:12
Quick snippet for installing Node on ARM devices.
# 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

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

/*
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

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:

@tlindsay
tlindsay / svg.html
Created June 9, 2017 19:58
Horizontally and Vertically Center SVGs
<style>
.wrapper {
position: relative;
svg {
bottom: 50%;
left: 50%;
position: absolute;
right: 50%;
top: 50%;
@tlindsay
tlindsay / Spotify-now-playing-on-TouchBar.scpt
Created June 23, 2017 15:36 — 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
-- 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 / wipcheck.sh
Last active July 26, 2018 15:43
WIP Check Pre-commit Hook
#!/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 / components.my-foo.js
Created August 14, 2019 20:57
lifecycle test
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 / pick-pr.sh
Created February 4, 2020 19:07
Choose open PR from a list and checkout
hub pr list | fzf | awk '{print $1}' | sed 's/\#//' | xargs hub pr checkout
@tlindsay
tlindsay / pick-branch.sh
Last active February 6, 2020 20:43
Choose a branch from an fzf list
git branch -lv | fzf | awk '{print $1}' | xargs git checkout