Skip to content

Instantly share code, notes, and snippets.

View bermanboris's full-sized avatar
🎯
Hyper Focusing

Boris Berman bermanboris

🎯
Hyper Focusing
  • Earth
View GitHub Profile
@bermanboris
bermanboris / webpack-symlink-trick.md
Created September 15, 2017 18:38 — forked from christiannaths/webpack-symlink-trick.md
Webpack: avoid relative import paths by symlinking a shortcut
@bermanboris
bermanboris / Layout.js
Created July 30, 2017 09:03 — forked from gustavlrsn/Layout.js
Example bootstrap 4 integration into Next.js, with the reactstrap package
import Head from 'next/head'
import { Container } from 'reactstrap'
const Layout = (props) => (
<div>
<Head>
<title>PairHub</title>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" />
</Head>
@bermanboris
bermanboris / postgres-notify-trigger.sql
Created February 11, 2017 10:26 — forked from bithavoc/postgres-notify-trigger.sql
I used this trigger to notify table changes via NOTIFY (migrating off RethinkDB)
CREATE OR REPLACE FUNCTION notify_trigger() RETURNS trigger AS $$
DECLARE
channel_name varchar DEFAULT (TG_TABLE_NAME || '_changes');
BEGIN
IF TG_OP = 'INSERT' THEN
PERFORM pg_notify(channel_name, '{"id": "' || NEW.id || '"}');
RETURN NEW;
END IF;
IF TG_OP = 'DELETE' THEN
PERFORM pg_notify(channel_name, '{"id": "' || OLD.id || '"}');