Skip to content

Instantly share code, notes, and snippets.

@crrobinson14
crrobinson14 / chatClient.js
Created January 23, 2020 20:36
WS/REST capable Chat / Action Handling client for ActionHero
const ReconnectingWebSocket = require('reconnecting-websocket');
const axios = require('axios');
const WS = require('ws');
// Written with ES5 metaphors to eliminate the need for Babel in test.
const KEY_CHARS = '0123456789abcdefghijklmnopqrstuvwxyz'.split('');
const generateRequestId = () => {
const uuid = [];
var pendingNotifications = {},
publicApi = {},
api;
// Dummy function to avoid an Unhandled Rejection error if the user is offline. Prevents us
// from needing to .catch() the notification result in every spot where we call it. Also a
// useful debugging point, so we don't just null it out.
function userNotOnline() {
}
@chales
chales / bbedit-pretty-json-readme.txt
Last active July 17, 2024 17:34
Make JSON legible with BBEdit
2016/03/15
Tested with BBEdit 11.5 / OS X 10.11.3 / Python 2.7.10
http://grokin.gs/blog/elegant-json-pretty-print-for-bbedit/
Place the script (or a link to this script) in the ~/Library/Application Support/BBEdit/Text Filters directory
Restart BBEdit.
The new filter should be under: "Test > Apply Text Filter > bbedit-pretty-json"
@JulienSansot
JulienSansot / ansible playbook for deploying a node app on ubuntu
Created June 3, 2015 06:29
ansible playbook for deploying a node app on ubuntu
---
- hosts: all
remote_user: ubuntu
vars:
app_repo: [email protected]:****/****.git
app_id: my_app
app_folder: /home/ubuntu/my_app
log_folder: /home/ubuntu/my_app_logs
tasks:
- name: git clone