Skip to content

Instantly share code, notes, and snippets.

@simon-weber
simon-weber / makefile
Last active October 11, 2015 17:37
makefile for a sparse parallel kernel source tree
KERNEL_MAKE_ARGS =
KERNEL_DIR = ../linux-2.6.26.5
# this isn't actually a list
DO_NOT_COPY = makefile
all: rm_moved_files src_copy
.FORCE:
@simon-weber
simon-weber / gist:1361260
Created November 12, 2011 23:02
Rails: for 'a belongs_to b', a.b.id != a.b_id
irb(main):010:0> t = Tag.new(:rfid => 999, :item_id => 1)
=> #<Tag id: nil, rfid: 999, created_at: nil, updated_at: nil, item_id: 1>
irb(main):011:0> t.item
=> #<Item id: 1, description: "burger", price: #<BigDecimal:b6f6f46c,'0.5E1',4(8)>, created_at: "2011-11-12 03:16:19", updated_at: "2011-11-12 03:16:19">
irb(main):012:0> t.item_id = 2
=> 2
irb(main):013:0> t.save