Skip to content

Instantly share code, notes, and snippets.

@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"
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 / 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 (⌥)

# Ghetto OCR
#
# Requires:
# - brew install imagemagick
# - brew install tesseract --all-languages
#
# Takes pdfs and spits out a txt file with anything it could OCR
function ocr {
if (( $# < 1 ))
then echo "usage: ocr filename.pdf"; return 1; fi
@pjaspers
pjaspers / gist:4041893
Created November 8, 2012 21:46
Quickly take a maxgif url to boom.
#! /usr/bin/env ruby
#
# Takes an URL from http://maxgif.com and copies the url of the shown gif
#
unless ARGV[0]
banner = <<BANNER
Takes a http://maxfig.com url and copies the direct link to the GIF. If
supplied a second argument, it is used as the name in `boom`.
Geachte,
De bedragen die u in rekening worden gebracht zijn helemaal niet willekeurig, het feit dat u in de complexe regelgeving a.h.w. door de bomen het bos niet meer ziet, draagt uiteraard wel bij tot het gevoel van schijnbare willekeur. Ik probeer even wat licht in de duisternis te werpen.
Zodra uw pakket de EU binnenkomt, rust er een belastingschuld op de goederen. Hoe die schuld er precies uit ziet, waaruit die is samengesteld en hoe groot die uiteindelijk is, hangt af van een combinatie van faktoren t.w. :
- de precieze aard van de goederen (die bepalen we a.d.h.v. een indeling in een goederennomenclatuur) ;
- de oorsprong van de goederen (niet te verwarren met de herkomst van de goederen) ;
- de waarde van de goederen (in een aantal gevallen baseren we ons niet op de waarde dan wel op ander grootheden zoals gewichten, volumes, gehaltes etc).
@pjaspers
pjaspers / methods.rb
Created September 26, 2012 19:54 — forked from keith/methods.rb
Prints ObjC method names to a file
#!/usr/bin/ruby
=begin
This is a simple script for printing out the methods in your Objective-C .h or .m file. It reads the passed file and stores just the method names in a text file
=end
# Default filename and type for the file output
DEFAULT_FILENAME = "outfile"

This week it's the the iPhone 5. Everyone pretty much accepts that Apple will introduce it, and there have been so many leaks that everybody pretty much seems to know what it's going to be. Word is it will look a lot like the last two versions of the iPhone, except a bit thinner and a bit taller, with upgraded guts and a refreshed operating system.

I also predict the next iPhone will be a bit better than the previous one.

The hardware on the iPhone has been the same for two years, since the iPhone 4 and 4S were virtually identical.

Hardware is the stuff I see on the outside, amiright?

Now, having had two years to plot and scheme, Apple's renowned designer Jonathan Ive has replaced the tiny 3.5in (8.9cm) screen with a slightly-less-tiny 4in (10.2cm) screen? Wow. Knock me over with a feather. What do you do with the rest of your time, Jony?

@pjaspers
pjaspers / GithubPatchor.js
Created August 7, 2012 19:00
Github support for Propane (from here: https://gist.github.com/1222697) Extracted for use in gasoline gem
/*
Adopted from here: https://gist.github.com/1222697
Add github repo descriptions to your Campfire rooms in Propane (propaneapp.com).
Adapted from protocool's https://gist.github.com/825404
*/
var githubber = true;
if (githubber) {
// github repo info inline
@pjaspers
pjaspers / gist:3288317
Created August 7, 2012 18:55
Seen here: https://gist.github.com/1042725 (extracted for use with gasoline gem)
/*
Display Gists inline.
This responder illustrates using Propane's requestJSON service to request
JSON from remote (non-authenticated) servers and have the results passed
to a callback of your choosing.
*/
var displayGists = true;
if (displayGists) {