Skip to content

Instantly share code, notes, and snippets.

View paularmstrong's full-sized avatar
🐈‍⬛
Codes with cats

Paul Armstrong paularmstrong

🐈‍⬛
Codes with cats
View GitHub Profile
@paularmstrong
paularmstrong / rm-branch_alias.sh
Created July 28, 2016 20:27
Because sometimes everything you wrote was bad.
# Completely remove the current branch from a git repo
function rm-branch() {
branch="$(git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')"
git checkout master
git branch -D $branch
}
@paularmstrong
paularmstrong / tdf2016.css
Last active July 6, 2016 14:12
Tour de France 2016 custom stylesheet for NBC Sports streams.
body {
background: #000 !important;
}
div#nbc-header {
display: none !important;;
}
div#player-wrapper + div,
div#player-wrapper + div + div {
@paularmstrong
paularmstrong / Safari GC Repro
Last active March 30, 2016 16:33 — forked from alunny/bundle.js
Safari GC Issue: Normalizr + Lodash
.
@paularmstrong
paularmstrong / wordpress-nfd-to-nfc-filename-conversion.sh
Created November 11, 2015 17:49 — forked from dessibelle/wordpress-nfd-to-nfc-filename-conversion.sh
Two commands needed to perform UTF-8 NFD to NFC decomposition on all files in a directory, and uploading the resulting directory to a webserver. Useful for treating files created on a Linux server (NFC), downloaded to Mac OS X (NFD) and needing to be uploaded back to the original server (NFC). Must, naturally, be run on Linux or at least used on…
#!/usr/bin/env bash
convmv -f utf8 -t utf8 --nfc --replace --nosmart --no-test -r uploads/
rsync -avz -e ssh uploads/ username@host:mysite.com/public_html/wordpress/wp-content/uploads
@paularmstrong
paularmstrong / README.md
Last active August 29, 2015 14:20
RetroPie Setup Instructions
  1. Use Apple Pie Baker to place the RPI v1* image to the SD Card
  • Note: even though it's a v2 RaspberryPi, for some reason v2 doesn't work.
  1. Start up the machine
  2. Exit emulationstation and set up the network
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
  ssid="network name"
  psk="password"
}
#!/bin/bash
# Optimize PNGs
for file in `git diff --cached --name-only | grep ".png\$"`; do
echo "Crushing $file"
pngcrush -rem allb -brute -reduce $file ${file%.png}.new 2>&1 | grep "filesize"
mv -f ${file%.png}.new $file
git add $file
done
#################################################################################
# start and stop the vpn from the command line from now on with these two commands
# or rename the aliases as you see fit.
#################################################################################
alias startvpn="sudo launchctl load -w /Library/LaunchDaemons/net.juniper.AccessService.plist; open -a '/Applications/Junos Pulse.app/Contents/Plugins/JamUI/PulseTray.app/Contents/MacOS/PulseTray'"
alias quitvpn="osascript -e 'tell application \"PulseTray.app\" to quit';sudo launchctl unload -w /Library/LaunchDaemons/net.juniper.AccessService.plist"

Non-HTML:

$ ./bin/swig.js render ./test1 -j ./data.json
onclick="pictureInsert(1, foo)"

HTML:

$ ./bin/swig.js render ./test2 -j ./data.json
, . .
. _.-=~~~--._
.+'#### ***#'+. . .
. .'/#######/ ; # ##'.
. / |###### ######\ .
.' \### \\ # ^ ###'.
(; |## . ___ ##) .
'. ## #####.#.'
. \ : #### #### / . .
'. ## ## .'
.row {
width: 100%;
padding: 0;
clear: both;
height: 1%;
}
.row:after {
display: block;
height: 0;
clear: both;