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 / 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;
}
}
autocmd BufWritePre * :%s/\s\+$//e
{% block header %}
<h1>{{ title }}</h1>
<p>A {{ environments|join(' & ') }} Template Engine</p>
{% endblock %}
@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, '...');
@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 / 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 / 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 / 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
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
@paularmstrong
paularmstrong / index.html
Last active December 10, 2015 04:48
Table vs Line-Height
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>table + line-height</title>
<style type="text/css">
* {
box-sizing: border-box;