Adrian's collection of super useful NPM packages.
- async - Higher-order functions and common patterns for asynchronous code.
var url = '/api/messages/stream-updates' + | |
'?access_token=' + LoopBackAuth.accessTokenId; | |
var src = new EventSource(url); | |
var changes = createChangeStream(src); | |
var set; | |
Message.find({ | |
filter: { | |
where: { |
#!/bin/sh | |
if [ "$(id -u)" != "0" ]; then | |
echo "Sorry, you are not root." | |
exit 1 | |
fi | |
if !(type pcp 2>/dev/null;) then | |
yum -y install git bison flex gcc-c++ perl-Tk-devel libmicrohttpd-devel | |
git clone git://git.pcp.io/pcp |
#!/usr/bin/env bash | |
# fresh-chrome | |
# | |
# Use this script on OS X to launch a new instance of Google Chrome | |
# with its own empty cache, cookies, and user configuration. | |
# | |
# The first time you run this script, it will launch a new Google | |
# Chrome instance with a permanent user-data directory, which you can | |
# customize below. Perform any initial setup you want to keep on every |
npm users sorted by the monthly downloads of their modules, for the range Mar 11, 2017 until Apr 11, 2017.
Metrics are calculated using top-npm-users.
# | User | Downloads |
---|
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /your/root/path; | |
index index.html; | |
server_name you.server.com; |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
# Advanced config for NGINX | |
server_tokens off; | |
add_header X-XSS-Protection "1; mode=block"; | |
add_header X-Content-Type-Options nosniff; | |
# Redirect all HTTP traffic to HTTPS | |
server { | |
listen 80; | |
server_name www.domain.com domain.com; | |
return 301 https://$host$request_uri; |
#move_uad_plugins.py - python script to remove unlicensed UAD plugin binaries from VST, AU and AAX folders | |
import os, shutil | |
#http://stackoverflow.com/a/800201/674745 | |
def get_immediate_subdirectories(a_dir): | |
return [name for name in os.listdir(a_dir) | |
if (os.path.isdir(os.path.join(a_dir, name)) and name != 'Mono')] |
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |