by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
CREATE FUNCTION notify_changes() RETURNS trigger AS $$ | |
DECLARE | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
PERFORM pg_notify('insert', json_build_object('table', TG_TABLE_NAME, 'new_val', row_to_json(NEW))#>>'{}'); | |
RETURN NEW; | |
ELSIF TG_OP = 'UPDATE' THEN | |
PERFORM pg_notify('update', json_build_object('table', TG_TABLE_NAME, 'new_val', row_to_json(NEW), 'old_val', row_to_json(OLD))#>>'{}'); | |
RETURN NEW; | |
ELSIF TG_OP = 'DELETE' THEN |
# db/migrate/20120625030355_add_deleted_at_to_user.rb | |
class AddDeletedAtToUser < ActiveRecord::Migration | |
def change | |
add_column :users, :deleted_at, :datetime | |
end | |
end |
Located in alphabetical order (not prefer)
C
ab
), also designed as a more modern replacement, written in C
golang
)# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key | |
# that enables you to choose a character from a menu of options. If you are on Lion | |
# try it by pressing and holding down 'e' in any app that uses the default NSTextField | |
# for input. | |
# | |
# It's a nice feature and continues the blending of Mac OS X and iOS features. However, | |
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode, | |
# as it means you cannot press and hold h/j/k/l to move through your file. You have | |
# to repeatedly press the keys to navigate. |