Skip to content

Instantly share code, notes, and snippets.

View seonixx's full-sized avatar

Simon White seonixx

View GitHub Profile

Keybase proof

I hereby claim:

  • I am seonixx on github.
  • I am simonwhite (https://keybase.io/simonwhite) on keybase.
  • I have a public key ASDuvzqODUVeDzAZUcVx8o1qMGRbWtXf-jE2pA-MyAEDWgo

To claim this, I am signing this object:

@seonixx
seonixx / fedev_exercise.js
Created May 29, 2018 10:51
Frontend Developer Code Review
class MyComponent extends React.Component {
constructor(props) {
// set the default internal state
this.state = {
clicks: 0
};
}
componentDidMount() {
this.refs.myComponentDiv.addEventListener('click', this.clickHandler);
var pg = require ('pg');
var EventEmitter = require('events');
var util = require('util');
// Build and instantiate our custom event emitter
function DbEventEmitter(){
EventEmitter.call(this);
}
util.inherits(DbEventEmitter, EventEmitter);
CREATE TRIGGER notify_new_order
AFTER INSERT
ON "order"
FOR EACH ROW
EXECUTE PROCEDURE notify_new_order();
@seonixx
seonixx / pg_notify_query.sql
Created August 7, 2017 20:39
pg_notify_query_example
CREATE OR REPLACE FUNCTION notify_new_order()
RETURNS trigger AS
$BODY$
BEGIN
PERFORM pg_notify('new_order', row_to_json(NEW)::text);
RETURN NULL;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
#!/bin/bash
BROWSERSTACK_TUNNEL_URL="https://www.browserstack.com/browserstack-local/BrowserStackLocal-linux-x64.zip"
BROWSERSTACK_TUNNEL_DIR="/tmp/browserstack-$RANDOM"
mkdir -p $BROWSERSTACK_TUNNEL_DIR
cd $BROWSERSTACK_TUNNEL_DIR
curl $BROWSERSTACK_TUNNEL_URL > BrowserStackLocal.zip
unzip BrowserStackLocal.zip