Skip to content

Instantly share code, notes, and snippets.

Waarom geen vliegtuigen?
- Vliegtuigen zijn gevaarlijk. Een ernstige ramp kan nooit worden uitgesloten.
- Er is geen veilige oplossing voor tijdens het neerstorten
- Vliegen is overbodig want de alternatieven zijn beschikbaar. Het is een kwestie van keuzes maken.
- Vliegtuigen werken het gebruik van atoomwapens in de hand.
Of
Waarom geen kernenergie?
@pjaspers
pjaspers / caveatpatchor.js
Created April 11, 2011 05:52
With Flickr support
/*
As of version 1.1.2, Propane will load and execute the contents of
~Library/Application Support/Propane/unsupported/caveatPatchor.js
immediately following the execution of its own enhancer.js file.
You can use this mechanism to add your own customizations to Campfire
in Propane.
Below you'll find two customization examples.
@pjaspers
pjaspers / DefaultKeyBinding.dict
Created April 26, 2011 07:42
A copy of my ~/Library/KeyBindings/DefaultKeyBinding.dict, pretty much copied off of @boredzo
{
/* Modifier keys: start with C-m */
"^m" = {
"^ " = ("insertText:", "\U2423"); /* C-space space */
/*This one added by boredzo.*/
"
" = ("insertText:", "\U23CE"); /* CR return */
/*These two modified by boredzo. 23CE was previously 21A9, and both were previously on e rather than r.*/
"^r" = ("insertText:", "\U23CE"); /* C-r return */
@pjaspers
pjaspers / gist:1083277
Created July 14, 2011 19:48
iPad check
// A check to see if we're running on an iPad.
// Blatantly picked up from: http://cocoawithlove.com/2010/07/tips-tricks-for-conditional-ios3-ios32.html
static inline BOOL IsIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] &&
[[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
{
return YES;
}
else
# setup
target = UIATarget.localTarget()
app = target.frontMostApp()
window = app.mainWindow()
# Some handy functions
dlog = (message) -> UIALogger.logDebug message
log = (message) -> UIALogger.logMessage message
should = (message) -> UIALogger.logStart "should #{message}"
fail = (message) -> UIALogger.logFail message
@pjaspers
pjaspers / De ideale snoepzak
Created August 4, 2011 08:27
De ideale snoepzak
- Gesuikerde kersen
- Zuurtjes
- spiegeleitjes
- zure matten.
- smurfen
- van die grote platte aardbeien
- poepegatjes.
- smoelentrekkers
- Neuzen (echte!)
- Mariakes
//
// Speciaal voor Inferis
// YES nil N
//Met ifs 0.452217
//Met statement 0.430586
//#######################
//
//NO nil N
//Met ifs 0.451592
@pjaspers
pjaspers / gist:1766661
Created February 8, 2012 08:08
Core Data Date type
# Returns a nicely formatted datestring instead of core data's weird datetype.
function cddate() {
ruby -e "puts Time.at(Time.gm("2001", "01", "01").to_i + $1)"
}
def xcode_proj_name
File.basename(Dir.glob("*.xcodeproj").first, ".xcodeproj")
end
desc "Reset Xcode's autocompletion"
task :reset_xcode do
home_folder = File.expand_path("~")
project_name = xcode_proj_name
Dir.glob("#{home_folder}/Library/Developer/Xcode/DerivedData/#{project_name}*").each do |folder_path|
puts "Deleting #{folder_path}"
@pjaspers
pjaspers / gist:3121827
Created July 16, 2012 09:35
Pukkelpop playlist creator
#! /Users/pjaspers/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
# -*- coding: utf-8 -*-
# (The spotify gem requires ruby 1.9.3)
#
# The [Hallon-gem](https://github.com/Burgestrand/Hallon/) for all things Spotify
require "hallon"
# Get an application key from Spotify (the binary kind), from [here](https://developer.spotify.com/en/libspotify/application-key/)
# The binary kind.
session = Hallon::Session.initialize(IO.read("./spotify_appkey.key"))