Skip to content

Instantly share code, notes, and snippets.

# Helper functions to interact with the DB of [gifwit](http://gifwit.com)
function gifcount() {
COUNT=$(gifme | wc -l)
echo "Current number of gifs: ${COUNT}"
}
# Usage: `gifme cats`
function gifme() {
db="${HOME}/Library/Containers/stevesmith.gifwit/Data/Library/Application Support/stevesmith.gifwitfiles/gifwit.storedata"
query="select ZURL, ZKEYWORDS from ZIMAGE where ZKEYWORDS LIKE '%$1%';"
@pjaspers
pjaspers / .pryrc
Last active August 29, 2015 14:04
if defined?(Rails) && Rails.env
begin
require 'hirb'
Hirb.enable
old_print = Pry.config.print
Pry.config.print = proc do |*args|
Hirb::View.view_or_page_output(args[1]) || old_print.call(*args)
end
rescue LoadError
puts "No hirb"
@pjaspers
pjaspers / gist:ec31fc5c2cce175e9ae0
Created June 5, 2014 22:08
Let over lambda-ish
func counter() -> (() -> Int) {
var x = 0
func add() -> Int {
x += 1
return x
}
return add
}
var count = counter()
@pjaspers
pjaspers / ATPFM.playground
Last active August 29, 2015 14:02
The ATP thshirt code in Swift. Paste in a playground, and you should see http://cl.ly/image/3W2P0N0d3b0u
import UIKit
class ATPLogoView: UIView {
override func drawRect(dirtyRect: CGRect) {
let fontName = "MyriadPro-Semibold"
let title = "Accidental Tech Podcast"
let initials = "ATP"
let rect = CGRectMake(CGPointZero.x, CGPointZero.y, self.bounds.size.height, self.bounds.size.width)
let w = rect.size.width
let offsetY = w * -0.07

Keybase proof

I hereby claim:

  • I am pjaspers on github.
  • I am pjaspers (https://keybase.io/pjaspers) on keybase.
  • I have a public key whose fingerprint is 55A7 095C 045A 5B11 76F5 9875 1FA2 68F4 5359 D229

To claim this, I am signing this object:

@pjaspers
pjaspers / keybase.md
Created April 4, 2014 15:21
keybase.md

Keybase proof

I hereby claim:

  • I am pjapsers on github.
  • I am pjaspers (https://keybase.io/pjaspers) on keybase.
  • I have a public key whose fingerprint is 55A7 095C 045A 5B11 76F5 9875 1FA2 68F4 5359 D229

To claim this, I am signing this object:

#! /usr/bin/env ruby
require "yaml"
require "pathname"
banner = <<BANNER
Looks for a config/database.yml file and supplies the command to get a
database dump/import. (mysql or postgres)
dumper <rails_env>
@pjaspers
pjaspers / gist:9131345
Last active April 28, 2022 07:52
ICQ list.
000787466 @bramus
006904094 @inferis
008093150 @tomklaasen
010686174 @to1ne
011006380 @tijs
023055424 @crahan
063846821 @junkiesxl
075540649 @maxvoltar
084511154 @atog
102812969 @nilo
#!/bin/bash
D=/Applications/Xcode.app/Contents/Developer/Library/Frameworks
OBJC=`awk '/^__OBJC__/ {print NR + 1; exit 0; }' $0`
RUBIES=`awk '/^__RUBY__/ {print NR + 1; exit 0; }' $0`
APP=`tail -n+$RUBIES $0`
# I moved the actual tests to another file
cat tests.x > /tmp/YOLOtests.m
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