Skip to content

Instantly share code, notes, and snippets.

Avatar

Steffel steffenix

View GitHub Profile
@steffenix
steffenix / 1_triggers.sql
Created Mar 11, 2019 — forked from fritzy/1_triggers.sql
Get table change notifications from Postgres as JSON
View 1_triggers.sql
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$
DECLARE
id bigint;
BEGIN
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
id = NEW.id;
ELSE
id = OLD.id;
END IF;
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text);
View gist:7463629
#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
View network.py
# Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
@steffenix
steffenix / rosbridge_websocket.launch
Last active Dec 28, 2015
rosbridge custom launch
View rosbridge_websocket.launch
<launch>
<arg name="port" default="10140" />
<arg name="ssl" default="false" />
<arg name="certfile" />
<arg name="keyfile" />
<arg name="authenticate" default="false" />
<param name="/rosbridge/port" value="$(arg port)"/>
<group if="$(arg ssl)">
You can’t perform that action at this time.