Skip to content

Instantly share code, notes, and snippets.

View warthurton's full-sized avatar

Wayne Arthurton warthurton

View GitHub Profile
javascript:(function(){var e=true;var r=null;var t=true;var n={javascript:"javascript",js:"javascript",python:"python",ios:"ios",youtube:"video",vimeo:"video",video:"video",books:"book",book:"book",game:"games",games:"games",recipe:"recipe",recipes:"recipe",food:"recipe",ingredients:"recipe",meal:"recipe"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=1e3;var c=function(e){return e.toLowerCase()};var u=function(e){return e?e.textContent.trim().replace(/\s+/g," ").substring(0,a):null};var l=c(document.title);var s=function(e){if(e){return l.indexOf(c(e))!==-1}else{return false}};var f=function(e,r,t){t=t||window;var n=e.length;var o;for(var i=0;i<n;++i){o=r.call(t,e[i]);if(o!==null){return o}}return null};var v=function(){var e=location.href;var r=location.hostname;var t;if(r in o){t=document.querySelector(o[r]);if(t){return u(t)}}var n=document.title;t=document.querySelector("meta[property='og:title']");if(t){n=t.content.trim().replace(/\s+/g," "
javascript:(function(){var e=false;var r=null;var t=true;var n={javascript:"javascript",js:"javascript",python:"python",ios:"ios",youtube:"video",vimeo:"video",video:"video",books:"book",book:"book",game:"games",games:"games",recipe:"recipe",recipes:"recipe",food:"recipe",ingredients:"recipe",meal:"recipe"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=1e3;var c=function(e){return e.toLowerCase()};var u=function(e){return e?e.textContent.trim().replace(/\s+/g," ").substring(0,a):null};var l=c(document.title);var s=function(e){if(e){return l.indexOf(c(e))!==-1}else{return false}};var f=function(e,r,t){t=t||window;var n=e.length;var o;for(var i=0;i<n;++i){o=r.call(t,e[i]);if(o!==null){return o}}return null};var v=function(){var e=location.href;var r=location.hostname;var t;if(r in o){t=document.querySelector(o[r]);if(t){return u(t)}}var n=document.title;t=document.querySelector("meta[property='og:title']");if(t){n=t.content.trim().replace(/\s+/g,"
javascript:(function(){!function t(e,n,r){function o(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){"use strict";e.exports={readLater:!1,appUrl:void 0,quoteSelection:!0,tagKeywords:{javascript:"javascript",js:"javascript",python:"python",functional:"functional",testing:"testing",youtube:"video",vimeo:"video",video:"video",books:"books",book:"books",github:"github",brooklyn:"brooklyn",motorcycles:"motorcycles",motorcycle:"motorcycles"},titleTweaks:{"github.com":".entry-title .js-current-repository"},descriptionTweaks:{"en.wikipedia.org":"#mw-content-text p"},textLengthLimit:2e3}},{}],2:[function(t,e,n){"use strict";var r=t("strip-utm"),
@warthurton
warthurton / play_all_voices.sh
Last active August 29, 2015 14:26 — forked from ttscoff/play_all_voices.sh
A quick Bash loop to play all available voices for OS X say command
#!/bin/bash
# Arguments can include a quoted string to define the test string to be repeated
# If an argument is numbers only, it changes the rate at which to speak (words per minute, default 200)
play_all_voices() {
local voice
local rate=200
local test_string="How are you?"
for arg in $@; do
if [[ $arg =~ ^[0-9]+$ ]]; then
on alfred_script(q)
tell application "System Events"
set numChrome to count (every process whose name is "Google Chrome")
if numChrome > 0 then
tell process "Google Chrome"
click menu item "pbrl" of menu "Bookmarks" of menu bar 1
end tell
end if
end tell

Code to make a markdown version of the twitter embed code. See result picture from DayOne at http://note.io/1iXW8Xl

Keybase proof

I hereby claim:

  • I am warthurton on github.
  • I am warthurton (https://keybase.io/warthurton) on keybase.
  • I have a public key whose fingerprint is 0F35 F2F2 5C98 E9E9 D515 EC3F 605F BC68 E81F 6532

To claim this, I am signing this object:

javascript:(function(){var e=false;var t=null;var n=false;var r={javascript:"javascript",js:"javascript",python:"Python",ios:"iOS",youtube:"video",vimeo:"video",video:"video",html:"HTML",css:"CSS",animation:"Animation",animate:"Animation",seo:"SEO",svg:"Vector",icon:"Icons",icons:"Icons",sass:"SASS",html5:"HTML5",grunt:"GruntJS",jquery:"jQuery"};var o={"github.com":".entry-title .js-current-repository"};var i={"www.kickstarter.com":".short-blurb"};var a=function(e){return e.toLowerCase()};var c=function(e){return e?e.textContent.trim().replace(/\s+/g," "):null};var u=a(document.title);var l=function(e){if(e){return u.indexOf(a(e))!=-1}else{return false}};var s=function(e,t,n){n=n||window;var r=e.length;var o;for(var i=0;i<r;++i){o=t.call(n,e.item(i));if(o!==null){return o}}return null};var f=function(){var e=location.href;var t=location.hostname;var n;if(t in o){n=document.querySelector(o[t]);if(n){return c(n)}}var r=document.title;n=document.querySelector("meta[property='og:title']");if(n){r=n.content.trim()
#!/usr/bin/ruby
# Example custom processor for use with Marked <http://markedapp.com> and Jekyll _posts
# It's geared toward my personal set of plugins and tags, but you'll get the idea.
# It turns
# {% img alignright /images/heythere.jpg 100 100 "Hey there" "hi" %}
# into
# <img src="../images/heythere.jpg" alt="Hey there" class="alignright" title="hi" />
#
# replaces alignleft and alignright classes with appropriate style attribute
# ---
- (NSInteger)colorNumber
{
if (_colorNumber < 0) {
NSString *hashName = self.nickname.lowercaseString;
if ([RZUserDefaults() boolForKey:@"UUIDBasedNicknameColorHashing"]) {
hashName = [NSString stringWithUUID];
}
self.colorNumber = (hashName.hash % _colorNumberMax);