Skip to content

Instantly share code, notes, and snippets.

Avatar
🎧

Glen Pike glenpike

🎧
View GitHub Profile
@glenpike
glenpike / gist:0b0d7619b73b1b5d937ae5bc09ec19b2
Created Jan 8, 2018
Express route to transcode an audio file.
View gist:0b0d7619b73b1b5d937ae5bc09ec19b2
//FIXME - investigate settings, etc.
function transcode(file) {
var spawn = require('child_process').spawn
var decode = spawn('flac', [
'--decode',
'--stdout',
file
])
@glenpike
glenpike / index.js
Created Apr 30, 2017
Serve Swagger Doc's with Koa
View index.js
/* Serve a swagger doc with Koa */
const Koa = require('koa');
const koaSwagger = require('koa2-swagger-ui');
//const yaml = require('yamljs');
//const spec = yaml.load('./music-api.yml');
const app = new Koa();
app.use(koaSwagger({
routePrefix: '/swagger', // host at /swagger instead of default /docs
@glenpike
glenpike / Dockerfile
Last active Feb 4, 2018
Quick and dirty Couchbase Server startup in a Docker container with docker-compose
View Dockerfile
FROM couchbase:community-4.5.0
EXPOSE 8091 8092 8093 9100 9101 9102 9103 9104 9105 9998 9999 11207 11209 11210 11211 11214 11215 18091 18092 18093 4369 21100-21300
ENV ADMIN_LOGIN=root
ENV ADMIN_PASSWORD=foobar
ENV CLUSTER_RAM_QUOTA=512
ENV CLUSTER_INDEX_RAM_QUOTA=256
@glenpike
glenpike / npm shell commands
Last active Feb 1, 2017
List all global npm packages when you want to install them with a new nvm version
View npm shell commands
#list top level packages, extract the package name, remove the .nvm line, remove the version number, reduce to single line
npm ls -g --depth=0 | cut -d ' ' -f2 | grep -v '.nvm' | sed -e 's/@.*//' | tr '\n' ' '
@glenpike
glenpike / flare.json
Last active Nov 1, 2016 — forked from GerHobbelt/.gitignore
d3.js: using tree layout for graphs which have nodes with multiple 'parents'
View flare.json
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 80, host: 8181
config.vm.provision :shell, path: "bootstrap.sh"
end
View onename blockchain
Verifying that +glenpike is my blockchain ID. https://onename.com/glenpike
You can’t perform that action at this time.