Skip to content

Instantly share code, notes, and snippets.

Avatar
🐈‍⬛
Codes with cats

Paul Armstrong paularmstrong

🐈‍⬛
Codes with cats
View GitHub Profile
@paularmstrong
paularmstrong / Safari GC Repro
Last active Mar 30, 2016 — forked from alunny/bundle.js
Safari GC Issue: Normalizr + Lodash
@paularmstrong
paularmstrong / wordpress-nfd-to-nfc-filename-conversion.sh
Created Nov 11, 2015 — 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…
View wordpress-nfd-to-nfc-filename-conversion.sh
#!/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 Aug 29, 2015
RetroPie Setup Instructions
View README.md
  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"
}
View pre-commit
#!/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
View OSX-junos_pulse_listenToMe.sh
#################################################################################
# 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"
View _readme.md

Non-HTML:

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

HTML:

$ ./bin/swig.js render ./test2 -j ./data.json
View paulstronaut.ascii
, . .
. _.-=~~~--._
.+'#### ***#'+. . .
. .'/#######/ ; # ##'.
. / |###### ######\ .
.' \### \\ # ^ ###'.
(; |## . ___ ##) .
'. ## #####.#.'
. \ : #### #### / . .
'. ## ## .'
View layout.css
.row {
width: 100%;
padding: 0;
clear: both;
height: 1%;
}
.row:after {
display: block;
height: 0;
clear: both;
@paularmstrong
paularmstrong / foo.test.js
Last active Mar 29, 2018
Mocha test runner with Require.js
View foo.test.js
define(['modules/foo'], function (foo) {
describe('test foo', function () {
// ...
});
});
View getters.diff
diff --git a/tests/variables.test.js b/tests/variables.test.js
index fc7cc70..162dc11 100644
--- a/tests/variables.test.js
+++ b/tests/variables.test.js
@@ -61,6 +61,9 @@ var cases = {
{ c: '{{ food.a }}', e: 'tacos' },
{ c: '{{ food["a"] }}', e: 'tacos' },
{ c: '{{ g[0][h.g.i]["c"].b[i] }}', e: 'hi!' },
+ ],
+ 'getters work just fine': [