Skip to content

Instantly share code, notes, and snippets.

View christopheranderton's full-sized avatar

Christopher Anderton christopheranderton

View GitHub Profile
@christopheranderton
christopheranderton / css-font-setting-the-standards-way.css
Last active February 22, 2016 07:28
Note: This is a old Gist. It may be deprecated. | Standards CSS Font Feature Settings instead of non CSS standard optimizeLegibility. However, it seems that Blink-based browsers (Chrome and Opera) adds extra padding for every word, thus breaking some layouts (specially grid based ones and css menus). Firefox and WebKit (Safari) does not seems to…
/* While most people are using text-rendering: optimizeLegibility;
* in their projects for better text rendering, it's actually non
* standard CSS (it's a SVG property).
* The standard way is to use the font feature settings for OpenType.
* The snippet below replicates text-rendering: optimizeLegibility;
*------------------------------------------------------------------- */
-moz-font-feature-settings:"kern" 1, "liga" 1;
-moz-font-feature-settings:"kern=1, liga=1";
-ms-font-feature-settings:"kern" 1, "liga" 1;
@christopheranderton
christopheranderton / wp-cli-update
Last active January 4, 2016 03:28
NOTE: This is a old Gist. It may work, but it can also be deprecated. | Update WP-CLI (WP-CLI itself, not a WordPress install).For use with your Terminal.app (or iTerm.app).
cd ~/.wp-cli
php composer.phar self-update
php composer.phar require 'wp-cli/wp-cli=@stable'
@christopheranderton
christopheranderton / homebrew-github-api-token.md
Last active January 2, 2024 13:07
Set your Github API Token If you hit a ”GitHub API rate limit exceeded” when searching with Homebrew (http://brew.sh/).

Description

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS
When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS

@christopheranderton
christopheranderton / github-brand-colors-aug-2015.css
Last active April 28, 2020 19:30
Official Github Brand Colors (August 20, 2015) from the GitHub internal CSS framework (Primer) version 2.3.3 at: http://primercss.io/colors/ [Note: Photoshop users. You can download the raw file (.css) and import the swatches just like a .aco file (more recent versions of Photoshop).
/* # OFFICIAL GITHUB BRAND COLORS
--------------------------------------------------------------------
Official Github Brand Colors (August 20, 2015) from the
GitHub internal CSS framework (Primer) version 2.3.3
Source URI: http://primercss.io/colors/
1.a = Github Branding Color Swatches
-------------------------------------------------------------------- */
.swatch-github-blue {
background-color:#4078c0;
@christopheranderton
christopheranderton / mute-macosx-startup-sound.sh
Last active July 5, 2019 13:21
Enable ”Mute” for the Startup sound on Mac OS X.
#!/bin/sh
osascript -e 'set volume with output muted'
@christopheranderton
christopheranderton / macosx-contextmenu-automator-touch.md
Last active February 3, 2024 17:45
Add a simple ”Touch” Service to your context menu (Right-Click Menu) in MacOS X (Tested in Mac OS X 10.10.5, but should work in older and newer versions as well) with Automator.app
  1. Open up Automator.app located in your Applications folder.
  2. Choose ”Service” in the dialog sheet when creating a new document.
  3. In the Services receives selected: menu at the top of the ”Canvas” on the right, change to ”Files & Folders”.
  4. In the sidebar to the left, search for Get Selected Finder Items
  5. Drag this Action to the ”canvas” on the right side.
  6. Again, go to the sidebar at the left and this time search for Run Shell Script
  7. Drag the Run Shell Script action to the ”canvas” on the right side.
  8. At the right in the Run Shell Script action, change the Pass input from to stdin to as arguments
  9. Copy paste this into the action text box, removing the Cat command in the text box:
@christopheranderton
christopheranderton / macosx-contextmenu-automator-svg2eps.md
Last active October 25, 2023 09:38
Add a ”SVG to EPS Converter” Service to your context menu (Right-Click Menu) in macOS/Mac OS X (Tested in Mac OS X El Capitan 10.11.6, but should work in some older versions and Sierra as well) using Homebrew installed svg2pdf and pdftops (Poppler) with Automator.app

1. What you need

  • macOS/Mac OS X (tested only on El Capitan, but should work on Sierra and older versions)
  • Xcode Command Line Tools / Xcode
  • Homebrew (http://brew.sh/)
  • svg2pdf (via Homebrew)
  • Poppler (via Homebrew)

2. Installing Homebrew, svg2pdf and Poppler

@christopheranderton
christopheranderton / macosx-contextmenu-automator-stripmetadata.md
Created February 2, 2017 13:45
Add a ”Strip Metdata” Service to your context menu (Right-Click Menu) in macOS/Mac OS X. This Service uses ExifTool and Tag (both via Homebrew) or xattr.

1. What you need

  • macOS/Mac OS X (tested only on El Capitan, but should work on Sierra and older versions)
  • Xcode Command Line Tools / Xcode
  • Homebrew (http://brew.sh/)
  • Tag (via Homebrew)
  • ExifTool (via Homebrew)

2. Installing Homebrew, Tag and ExifTool

@christopheranderton
christopheranderton / unicode-horizontal-row-shell.sh
Last active March 16, 2017 12:17
Prints a Funky Horizontal Row of a Unicode Character. Includes examples using lolcat and lolcat with animation. Great to add a little bling bling to your shell scripts.
## Prints a Horizontal Row of a Unicode Character
# Screenshot: http://imgur.com/a/Z2nKx
# Use for: Pattern or Separator
# Requirements: tput, Unicode font(s),
# True Color Terminal, LOLCAT (optional)
# Tested on OS X/macOS (10.11.6) and
# Ubuntu Linux (March 2017)
@christopheranderton
christopheranderton / opera-mac-internal-pages-and-more.md
Last active February 26, 2024 04:15
A list of internal (and external) pages and useful information for macOS/OS X users (and others) of the Chromium/Blink based version of the web browser Opera.

Opera Development Icon