Skip to content

Instantly share code, notes, and snippets.

@pjaspers
pjaspers / gist:5598144
Created May 17, 2013 09:58
Controlling VoiceOver using an Apple Wireless Keyboard

Controlling VoiceOver using an Apple Wireless Keyboard

VoiceOver Help speaks keys or keyboard commands as you type them. You can use VoiceOver Help to learn the keyboard layout and the actions associated with key combinations.

Use VoiceOver keyboard commands to navigate the screen, select items, read screen contents, adjust the rotor, and perform other VoiceOver actions. Most keyboard commands use the Control-Option key combination, abbreviated in the table below as "VO."

VoiceOver keyboard commands

VO = Control-Option (⌥)

var svg = d3.select(".jumbotron").append("svg")
.attr("width", width)
.attr("height", height)
.attr("id", "chart")
// @bluecrowbar:
// These will resize the graph according to browser. Which is tres cool, but is too large at start.
// .attr("viewBox", "0 0 " + width + " " + height )
// .attr("preserveAspectRatio", "xMinYMin meet")
// .attr("style", "display: block; width: 80%; margin: 0 auto;}")
.append("g")
@pjaspers
pjaspers / drsh.rb
Last active October 11, 2017 09:57
Homebrew formula to install drsh
require 'formula'
class Drsh < Formula
homepage 'http://pjaspers.github.io/drsh/'
url 'https://github.com/pjaspers/drsh/archive/0.0.3.zip'
sha256 'c846ce952521f0723cdde9a1150a5be7b1694ba7d616a9efd1714b76be6f5206'
depends_on "jq"
depends_on "spark"
@pjaspers
pjaspers / gist:6624364
Created September 19, 2013 14:29
Joe Armstrong on programmer productivity
Once upon a very long time ago we did a project to compare the efficiency of
Erlang to PLEX.
We implemented "the same things" (TM) in Erlang and PLEX and counted total man hours
We did this for several different things.
Erlang was "better" by a factor of 3 or 25 (in total man hours) - the weighted average was a factor 8
They asked "what is the smart programmer effect"
@pjaspers
pjaspers / gist:6669390
Last active December 23, 2015 17:29
ruby-2.1.0-preview1 changes in code samples.
# def foo now returns a symbol instead of nil, allowing for something like this
class Thing
protected def some;end
protected def like; end
def it; end
protected def hot; end
end
Thing.new.protected_methods
@pjaspers
pjaspers / gist:6761954
Created September 30, 2013 10:30
Propane helper to display cloudup images inline
/*
Display CloudUp images inline.
*/
Campfire.CloudUpExpander = Class.create({
initialize: function(chat) {
this.chat = chat;
var messages = this.chat.transcript.messages;
for (var i = 0; i < messages.length; i++) {
this.detectCloudUpURL(messages[i]);
@pjaspers
pjaspers / bob_franzlet.js
Last active December 26, 2015 03:59
Bob & Franz bookmarklet Bookmarklet to instantly display Bob & Franz.
// Bob & Franz bookmarklet
//
// Bookmarklet to instantly display Bob & Franz.
//
// Using the Google Closure Compiler to minify the JS:
//
// curl -O -XPOST -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_info=compiled_code -d output_format=text --data-urlencode "[email protected]" http://closure-compiler.appspot.com/compile
//
// Cats should have their own namespace
window.BobFranz = {};
@pjaspers
pjaspers / gist:7246746
Created October 31, 2013 09:24
Quick way to get a public key into your clipboard.
# Takes a Github Username and copies his/her public key
#
# ghkey pjaspers
#
function ghkey {
if (( $# < 1 ))
then echo "usage: ghkey <username>"; return 1; fi
curl -sL https://github.com/$1.keys | pbcopy
}
class Song
# Create a new Song.
#
# path - The spotify path
#
# Returns nothing.
def initialize(options={})
self.path = options[:path] if options[:path]
cache_album_art
end
def convert_command(command, *args)
args.map! do |word|
if word.is_a?(TrueClass) || word.is_a?(FalseClass)
word ? '1' : '0' # convert bool to 1 or 0
elsif word.is_a?(Range)
if word.end == -1 # negative means to end of range
"#{word.begin}:"
else
"#{word.begin}:#{word.end + (word.exclude_end? ? 0 : 1)}"
end