Skip to content

Instantly share code, notes, and snippets.

@jahio
jahio / gist:7240249
Last active December 27, 2015 00:49
ruby test inside script
require "test/unit"
class SomeClass
end
if $0 == __FILE__
class SomeClassTestUnit < Test::Unit::TestCase
def test_something
# does something here
/* Remaps the OS X home and end keys on your keyboard to go to the beginning,
and end of the line respectively. Emulates Windows behavior - one of the
few things about Windows I actually liked back in the day.
Put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict. Create the
directory under ~/Library if it doesn't yet exist (~/Library should). Then
put this file in there. Rememebr to re-launch and program/process that you
want to be able to use the new keymaps in. Or just logout and log back in,
or you could reboot but that might be a little overkill.
@jahio
jahio / gist:6073520
Created July 24, 2013 19:10
Typecasting data coming out of hstore
testing=# \d foo
Table "public.foo"
Column | Type | Modifiers
--------+--------+-----------
id | uuid | not null
stuff | hstore |
Indexes:
"foo_pkey" PRIMARY KEY, btree (id)
testing=# SELECT * FROM foo;