Skip to content

Instantly share code, notes, and snippets.

@bkerley
bkerley / slugs.rb
Last active December 10, 2015 02:58
> ruby slugs.rb
id: 1639513188
enciphered output, string-escaped for your convenience:
"X\xD0\x97N"
slug: lt1krc
decrypted id: 1639513188
the same?
true
# encoding: utf-8
require 'set'
require 'pp'
class Set
def ∩(*args)
intersection *args
end
def ∪(*args)
@bkerley
bkerley / gist:4115142
Created November 20, 2012 00:28
ruby developers in south florida
  • carecloud
  • demohire
  • saveology
  • workbeast
  • intergi
  • macneill group
  • citrix
@bkerley
bkerley / @for
Created November 7, 2012 19:50 — forked from lessallan/@for
@for
@for $i from 1 through 35
.picture:nth-child($i)
+animate(fadeIn, 1s, ($i)s)
package=basho-release-6-1.noarch.rpm && wget http://yum.basho.com/gpg/$package -O /tmp/$package && sudo rpm -ivh /tmp/$package
> exiftool /Volumes/Macintosh\ HD/Users/bkerley/Pictures/iPhoto\ Library/Masters/2012/05/18/20120518-172608/IMG_2232.JPG | grep GPS
GPS Latitude Ref : North
GPS Longitude Ref : West
GPS Time Stamp : 21:25:29.42
GPS Latitude : 25 deg 48' 0.00" N
GPS Longitude : 80 deg 12' 0.00" W
GPS Position : 25 deg 48' 0.00" N, 80 deg 12' 0.00" W
> exiftool /Volumes/Macintosh\ HD/Users/bkerley/Pictures/iPhoto\ Library/Masters/2012/07/09/20120709-172924/IMG_2534.JPG | grep GPS
GPS Latitude Ref : North
GPS Longitude Ref : West
def normalize_date(date, default)
case date
when String
Date.parse(date).iso8601 # raise exceptions if it's bad, desired behavior
when Date
date.iso8601
when Time
date.to_date.iso8601
when nil
default.iso8601
@bkerley
bkerley / gist:3389849
Created August 18, 2012 21:04
decentralized microbloggin'

I'm using "microgbloggin'" as a euphemism for Twitter, which is also a company that owns servers and controls how content on those servers is disbursed.

Microbloggin' features:

  • canonical names for status feeds (e.g. BonzoESC on twitter)
  • creating, reading, and deleting statuses
  • creating, reading, and deleting followings
  • creating mentions inline with statuses
  • it's all https (or some caveman plaintext http crap) so making clients is easy
@stack = []
@stack.push 3
@stack.push 5
@stack.push(@stack.pop + @stack.pop)
puts @stack.pop
> erl
Erlang R13B01 (erts-5.7.2) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.2 (abort with ^G)
1> X = atom.
atom
2>
User switch command
--> c
X.