Skip to content

Instantly share code, notes, and snippets.

View ckross01's full-sized avatar

Chris Ross ckross01

View GitHub Profile
// dont do this
// arbitrary examples but this would be faster
// just using normal nodejs promises
const axios = require("axios");
const assert = require("assert");
const {
Worker,
MessageChannel,
@ckross01
ckross01 / API.md
Created June 28, 2018 18:14 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({port: 8080});
var jwt = require('jsonwebtoken');
/**
The way I like to work with 'ws' is to convert everything to an event if possible.
**/
function toEvent (message) {
try {
@ckross01
ckross01 / projectExamples
Last active August 29, 2015 14:07
Node Project Structure Examples
List of NodeJS Projects with good structure, folder layout, etc.
Habit RPG
https://github.com/HabitRPG/habitrpg
The New NPM Site
https://github.com/npm/newww
NodeBB
https://github.com/NodeBB/NodeBB
@ckross01
ckross01 / gist:5511804
Created May 3, 2013 17:41
if(window.location.hash.indexOf('thisTest') > 0 { $('#selector').trigger('click'); }
if(window.location.hash.indexOf('thisTest') > 0 {
$('#selector').trigger('click');
}