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 / 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 / index.html
Created November 24, 2012 03:35
Spritesheet animation tester
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Sprite Animation Tester</title>
<style type="text/css">
* {
@paularmstrong
paularmstrong / install.sh
Created October 10, 2012 04:51 — forked from maggit/install.sh
Chef installer for OS X 10.8 Mountain Lion
#!/bin/bash
# This is the current stable release to default to, with Omnibus patch level (e.g. 10.12.0-1)
# Note that the chef-full template downloads 'x.y.z' not 'x.y.z-r' which should be a duplicate of the latest -r
release_version="10.12.0-1"
use_shell=0
# Check whether a command exists - returns 0 if it does, 1 if it does not
exists() {
if command -v $1 &>/dev/null
@paularmstrong
paularmstrong / media-queries.less
Created July 11, 2012 16:38
Media Query variables in LESS
@mq-phone: ~'(max-width: 767px)';
@mq-tablet: ~'(min-width: 768px) and (max-width: 979px)';
@mq-desktop: ~'(min-width: 980px)';
@mq-dpi-2: ~'(-webkit-min-device-pixel-ratio: 2)';
@media @mq-phone {
// styles for phone
}
@media @mq-tablet {
@paularmstrong
paularmstrong / verifyemail.js
Created June 28, 2012 19:13
Verify email addresses
// Verify an email address
// Usage: node verifyemail.js billgates@gmail.com
var exec = require('child_process').exec,
net = require('net'),
email = process.argv.splice(2)[0],
domain = email.split('@')[1];
function verify(mxrecord) {
console.log('connecting to', mxrecord, '...');
{% block header %}
<h1>{{ title }}</h1>
<p>A {{ environments|join(' & ') }} Template Engine</p>
{% endblock %}
autocmd BufWritePre * :%s/\s\+$//e
@paularmstrong
paularmstrong / styles.css
Created October 30, 2011 17:36
Remove Mobile Safari's flippin' inner shadow on form elements
@media all and (max-device-width: 1024px) {
input, select, textarea, button {
/* Flippin mobile Safari's flippin inner shadow of annoyance */
-webkit-appearance: caret;
}
}
@paularmstrong
paularmstrong / links.css
Created October 21, 2011 16:41
Create a larger hit area for links with a nicely sized background color hover state that doesn't throw off the inline layout of your text.
@paularmstrong
paularmstrong / Makefile
Created September 30, 2011 01:55
node package to browser
browser:
@rm -rf browser/dist
@mkdir -p browser/dist
@echo "swig = (function () {" >> $(BROWSER_FILE)
@echo "var swig = {}," >> $(BROWSER_FILE)
@echo " dateformat = {}," >> $(BROWSER_FILE)
@echo " filters = {}," >> $(BROWSER_FILE)
@echo " helpers = {}," >> $(BROWSER_FILE)
@echo " parser = {}," >> $(BROWSER_FILE)
@echo " tags = {};" >> $(BROWSER_FILE)