Skip to content

Instantly share code, notes, and snippets.

( ͡ᵔ ͜ʖ ͡ᵔ )

Max Ogden maxogden

( ͡ᵔ ͜ʖ ͡ᵔ )
View GitHub Profile
maxogden /
Last active Oct 20, 2020
node modules for converting PDFs into other formats
maxogden /
Last active Sep 29, 2020
merkle dag replication draft

Synchronization for Merkle graphs



  • Problem we’re solving: Efficient p2p Merkle DAG replication
  • Proposed solution in a nutshell: Simplistic and symmetric protocol with reference implementation in Node.js
maxogden / index.js
Created Jan 19, 2016
requirebin sketch
View index.js
var raf = require('raf')
var hypotrochoid = require('hypotrochoid')
var canvas = document.createElement('canvas')
var ctx = canvas.getContext('2d')
var output = []
var width
var height
var radii = [
maxogden /
Last active Sep 24, 2020
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
  1. compile ffmpeg for arm
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://<SESSION>

you can tweak -b and -fps to your liking. the settings above work well for 1080p. by not specifying width or height we get the full 1920x1080 resolution from the raspi camera

maxogden /
Last active Sep 11, 2020
How-to: Write a node module with voxel.js

Writing node modules with voxel.js

This is a short guide that will teach you the workflows that have been figured out by the voxel.js community for writing node modules + sharing them on NPM and Github. It is assumed that you have a basic understanding of JavaScript, github and the command line (if not you can check out an introduction to git and the command line or learn JS basics from JavaScript for Cats)

The voxel-tower repository on github contains all the example code from this guide.

Table of contents

maxogden / config.boot
Last active Sep 1, 2020
edgerouter lite centurylink fiber pppoe configuration
View config.boot
firewall {
all-ping enable
broadcast-ping disable
ipv6-receive-redirects disable
ipv6-src-route disable
ip-src-route disable
log-martians enable
name WAN_IN {
default-action drop
description "WAN to internal"
maxogden / index.js
Last active Aug 13, 2020 — forked from sethvincent/index.js
requirebin sketch
View index.js
var inherits = require('inherits');
var Game = require('crtrdg-gameloop');
var Entity = require('crtrdg-entity');
var Keyboard = require('crtrdg-keyboard');
inherits(Player, Entity);
function Player(options){
this.position = {
x: options.position.x,
maxogden / index.html
Created Mar 29, 2014
load a <script> tag from a gist raw url
View index.html
<!doctype html>
<style type="text/css">
html, body { margin: 0; padding: 0; }
<script type='text/javascript'>
function loadRaw(gistID) {
maxogden /
Last active Jul 28, 2020
cool shell commands

mplayer with album art rendering

find "$(pwd)" -name "*.mp3" -print0 | sort -zR > /tmp/playlist.tmp && xargs -a /tmp/playlist.tmp -n 1 -I {} --null bash -c 'kitty-img-show "{}" && mplayer -playlist <(echo "{}")'

line count of all files in a tree

( find ./ -type f -print0 | xargs -0 cat ) | wc -l
maxogden /
Created Nov 24, 2016
4k timelapse ffmpeg
ffmpeg -r 25 -pattern_type glob -i '*.jpg' -vf scale=3840:-1 -vcodec libx264 -crf 25 OUTPUT.MP4
You can’t perform that action at this time.