Skip to content

Instantly share code, notes, and snippets.

View andytlr's full-sized avatar

Andy Taylor andytlr

View GitHub Profile
@andytlr
andytlr / proofer.ino
Created March 15, 2017 03:14
Bread Proofer Arduino Project
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int ThermistorPin = 0;
int relayPin = 10;
int Vo;
float R1 = 10000;
float logR2, R2, T, Tc;
# Takes one URL per line on the clipboard.
# Opens each one in a new tab in the default browser.
touch temp.txt
pbpaste > temp.txt
echo "" >> temp.txt
cat temp.txt | while read a; do open $a; done
rm temp.txt
@andytlr
andytlr / spotify-genres.md
Created January 22, 2016 02:26
Spotify Genres

Spotify has heaps of genres but there not surfaced in the UI. Here's 1383 (perhaps all) of them.

Search for genre:"Genre Name"

  1. A Cappella
  2. Abstract
  3. Abstract Beats
  4. Abstract Hip Hop
  5. Abstract Idm
  6. Abstractro
# List merged branches
git branch --merged
# Delete all merged branches.
git branch --merged | grep -v "\*" | grep -v master | xargs -n 1 git branch -d
# Restage last commit. E.g. Whoops, just committed to master.
git reset --soft HEAD~
@andytlr
andytlr / snippets.md
Last active July 16, 2018 07:35
Swift Snippets

Swift Snippets

Change Status Bar

To make it light, put this inside the View Controller class:

override func preferredStatusBarStyle() -> UIStatusBarStyle {
    return .LightContent
}
@andytlr
andytlr / byword-delete-line.scpt
Last active August 29, 2015 14:27
Replicates 'Delete Line' functionality in Byword
-- Byword doesn't have a Delete Line function.
-- This is basically a macro to select the current line and delete it.
-- Make a Service that recieves no input and assign a keyboard shortcut.
on run {input, parameters}
tell application "System Events"
-- Command + Option + Up
key code 126 using {command down, option down}
-- Command + Option + Up
@andytlr
andytlr / non-public-screenshot.sh
Created June 23, 2014 02:02
Non-public Dropbox folder screenshot
dropboxuser=21267 # Replace with your ID
directoryname=shots
filename=shot_`date '+%Y-%m-%d_%H-%M-%S'`.png
path=~/Dropbox/$directoryname/
mkdir -p $path
screencapture -o -i $path$filename
open --reveal $path$filename
n=0
while read line ; do
let n=n+1
filename=`basename "$line"`
dropboxuser=21267 # Replace with your ID
directory=/shots/keep/ # This is the full path iside your Public Dropbox directory. The slashes are important.
path=~/Dropbox/Public$directory
mkdir -p $path
date=$(date +%H-%M-%S)-
if [ -f $path$filename ] ;then
@andytlr
andytlr / screenshots.sh
Last active August 29, 2015 14:01
Better OS X Screenshots
# This will capture a screenshot, put it in your Public Dropbox folder,
# reveal it in Finder and copy a sharable URL to the clipboard. E.g.
# https://dl.dropboxusercontent.com/u/21267/shots/shot_2014-05-19_12-30-48.png
# Uncomment options below for things like opening in Preview,
# copying a Markdown/HTML image tag etc.
# Replace with your Dropbox user ID.
#
# Share something from your Public folder to find it.
@andytlr
andytlr / _description.md
Last active August 1, 2023 08:02
Convert SVG <polyline> to <path> so they can be animated with D3 etc.

Convert SVG polyline to path

Replace all instances of <polyline with <path and points=" with d="M.

 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
 <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1000px" height="1000px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
-<polyline fill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" points="100.712,141.534 582.904,227.835 425.37,478.521
+