Skip to content

Instantly share code, notes, and snippets.

View andytlr's full-sized avatar

Andy Taylor andytlr

View GitHub Profile
@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
@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
+
@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 / 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
{% capture truncated_content %}{{ page.content | truncatewords: 250 }}{% endcapture %}
{% if page.content != truncated_content %}
Reading time ~<span class="time">{{ page.content | number_of_words | append: '.0' | divided_by:180 }}</span>min.
{% endif %}
# 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 / gist:4052412
Created November 10, 2012 20:41
Insert time and date
do shell script "date +%Y-%m-%d\\ %H:%M:%S"
@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