Skip to content

Instantly share code, notes, and snippets.

View christopheranderton's full-sized avatar

Christopher Anderton christopheranderton

View GitHub Profile
@pal
pal / remove_duplicates.sh
Created March 20, 2011 18:02
Removes duplicate files (found using SHA1 checksum)
#!/bin/bash
# Used in an Automator action that is run as a Image Capture Plugin after file organization
#Delete duplicate files starting at $1 recursive
SRC_DIR=${1:-"$HOME/Backuped/originals/pictures"} # defaults to "$HOME/Backuped/originals/pictures"
temp_file="/tmp/fl$$" # $$ is process ID
find "$SRC_DIR" -type f -exec shasum {} \; | sort -r > $temp_file
# use substr($0, index($0, " ")); instead of $2 to handle filenames with spaces
@jaygooby
jaygooby / os-x-ghostscript-imagemagick
Last active March 9, 2018 16:06
Download and install imagemagick plus configure automator app for converting PDFs to PNGs
#!/usr/bin/env bash
# Install using:
# bash < <(curl -s https://gist.githubusercontent.com/jaygooby/1248106/raw/6d8ef1c0c84a47a34a6890973c8d32d22466a736/os-x-ghostscript-imagemagick)
IM_TGZ=ImageMagick-x86_64-apple-darwin17.3.0.tar.gz
IM_URL=https://www.imagemagick.org/download/binaries/$IM_TGZ
IM_TMP_FILE=/tmp/$(basename $IM_URL)
IM_SUM="33849 17409"
@matthiaspabst
matthiaspabst / wordpress-post-thumbnail-grid-style.css
Last active May 13, 2021 03:16
WordPress page template for a post thumbnail grid
/* Post Thumbnail Grid */
.gridcontainer h2 a{color: #333; font-size: 13px;}
.gridcontainer .griditemleft{float: left; width: 150px; margin: 0 30px 20px 0;}
.gridcontainer .griditemright{float: left; width: 150px;}
.gridcontainer .postimage{margin: 0 0 5px 0;}
.gridcontainer .postimage-title {text-align: center;}
@dgmid
dgmid / AutoCompletion.plist
Created April 1, 2012 07:42
Updated AutoComplete.plist for CSSEdit 2.6.1 with CSS3 & Vendor Specific properties
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!--
This document has been divided up in to the following sections:
1) CSS3 Properties
2) Vendor Prefixed Properties
3) Extras
4) Standard CSSEdit plist
@johnpbloch
johnpbloch / README.md
Created August 23, 2012 13:55
A bash script to make .pot files for WordPress plugins

Installation

To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:

sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n

You don't have to put the library in /usr/lib/wpi18n, but if you don't put it there, make sure to set the $WP_I18N_LIB environment variable in your .bashrc file (with no trailing slash):

export WP_I18N_LIB="/path/to/i18n/lib"

@Lammerink
Lammerink / CSS : Web Font Stacks.css
Last active April 5, 2018 13:10
CSS : Web Font Stacks
@charset "UTF-8";
/* Web Font stacks */
/* The Times New Roman-based serif stack: */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
/* A modern Georgia-based serif stack:*/
font-family: Constantia, "Lucida Bright", Lucidabright, "Lucida Serif", Lucida, "DejaVu Serif," "Bitstream Vera Serif", "Liberation Serif", Georgia, serif;
/*A more traditional Garamond-based serif stack:*/
@riccardomarotti
riccardomarotti / gist:4737373
Last active September 9, 2016 12:10
Resizes images passed as arguments to RESIZE_WIDTH x RESIZE_HEIGTH, stretching source image. Meant to be used in Automator.
#! /usr/bin/python
import sys
import CoreGraphics
RESIZE_WIDTH = 100
RESIZE_HEIGHT = 100
def resizeimage(source_image_file, target_image_file, target_width, target_height):
source_image = CoreGraphics.CGImageImport (CoreGraphics.CGDataProviderCreateWithFilename(source_image_file))
@sugarmo
sugarmo / json-to-plist.sh
Last active December 6, 2020 03:06
A shell script for Automator that can convert JSON to .plist file.
for f in "$@"
do
filename="${f%.*}"
plutil -convert xml1 "$filename".json -o "$filename".plist
done
@grigs
grigs / gist:5778632
Last active September 24, 2017 08:49
Quick notes on TVs and standards

I need to write this up in more detail soon, but in chatting with Patrick, it is clear that 140 chars isn't cutting it.

The way I've been thinking about the web on TVs and consoles is something like this:

  • What are the design patterns and interaction models that would make for a successful experience?
  • Can we build those experiences now? If not, what would need to change to make it possible?

In my mind, this starts with the basics of designing an interface that works well on a TV and can be interacted with using a remote control. Once we have the basics out of the way, we can proceed to multiscreen interactions.

A basic television layout

@johan
johan / osx.sh
Last active October 18, 2018 20:47
OSX dotfile notes
# inspired by https://github.com/alias-mac/dotfiles/blob/master/osx/set-defaults.sh
# Enable full keyboard access for all controls (System Preferences → Keyboard → Keyboard Shortcuts)
# (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Change "Move focus to next window" shortcut to ⌘<
/usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:51:value:parameters:0 60" ~/Library/Preferences/com.apple.symbolichotkeys.plist
# and "Move focus to the widnow drawer" shorcut to ⌥⌘<
/usr/libexec/PlistBuddy -c "Set :AppleSymbolicHotKeys:51:value:parameters:1 50" ~/Library/Preferences/com.apple.symbolichotkeys.plist
# and never s/autocorrect/autodestroy/; it gets right things wrong more often than the other way around for me