Skip to content

Instantly share code, notes, and snippets.

// To subscribe to an event, pass this JSON text to the client through the WebSocket:
{
"body": {
"eventName": "NameOfEvent" // Replace with an event name listed below
},
"header": {
"requestId": "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxx", // UUID
"messagePurpose": "subscribe",
"version": 1, // Protocol version (currently 1 as-of 1.0.2)
@dezoito
dezoito / gulpfile.js
Created January 4, 2016 19:24
Super simple Django + BrowserSync Gulpfile
// Assuming you already have NodeJS, npm and gulp installed
// and followed instructions at:
// https://www.browsersync.io/docs/gulp/
//
// save this file at <<DJANGO PROJECT ROOT>>
// on your terminal:
// $ cd <<DJANGO PROJECT ROOT>>
// $ gulp
// this will open a browser window with your project
@sundaycrafts
sundaycrafts / preventPullToRefresh.js
Created May 23, 2015 06:16
prevent pull to refresh mobile chrome feature
/**
* inspired by jdduke (http://jsbin.com/qofuwa/2/edit)
*/
var preventPullToRefresh = (function preventPullToRefresh(lastTouchY) {
lastTouchY = lastTouchY || 0;
var maybePrevent = false;