Skip to content

Instantly share code, notes, and snippets.

🌪
Working on *everything*

Cliff Hall cliffhall

Block or report user

Report or block cliffhall

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View a-sinewav3-plugin-example-using-modulators-and-eases.md

The Sinewav3 Plugin example 'Sparks Fly' creates a particle system simulating sparks which dim as they age, while moving in a realistic fashion.

A number of settings are exposed for the particle system emitter and its movement as well as the protoypical spark particle and its movement. The code demonstrates the use of audio modulation and easing.

Learn more about this plugin here: https://medium.com/sinewav3/make-sparks-fly-c48e94219d4f

@cliffhall
cliffhall / a-simple-sinewav3-plugin-example.md
Last active Apr 17, 2018
Sinewav3 Plugin Example 'Tentacles'
View a-simple-sinewav3-plugin-example.md
@cliffhall
cliffhall / index.js
Last active Nov 29, 2018
Using Firebase Cloud Functions to Manage a Compound Key Index
View index.js
/**
* Function: indexArtist
*
* Triggered by writes to: /artists/:id
* Responds by writing to: /indexes/artist_by_genre (once for each Genre the Artist has chosen)
*
* If there was a previous value, all associated index entries are removed first.
* So, if the artist display name has changed or the genre list has changed,
* the index will be properly synchronized.
*
@cliffhall
cliffhall / nuke-firebase-db-and-users-referenced-therein.js
Last active Sep 24, 2018
Nuke a Firebase Database and All User Accounts Referenced Therein
View nuke-firebase-db-and-users-referenced-therein.js
// NOTE: Accounts that are not represented in your /users node will not be deleted!
// BLOG: There are other approaches, see: http://cliffordhall.com/2017/04/nuke-firebase-db-and-all-users/
"use strict";
// Get credentials and initialize firebase app
console.log("With the power vested in the admin user, lay waste the database and all its users!");
let admin = require("firebase-admin");
let serviceAccount = require([__dirname, "service-account-key.json"].join('/'));
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
View an-end-to-end-video-build-demo.md

This demo builds on previous gists in this series to render an audio-modulated WebGL animation, and output a 48 FPS, 1080p, HD video utilizing:

  • HTML5's Web Audio API for analysing an audio file.
  • HTML5's Web Worker API for offloading communications between the web page and the server to separate thread.
  • Socket.io for sending messages (including image and audio files) between client and server.
  • Node.js for the server process for storing generated images and uploaded audio and creating the final video.
  • FFMpeg for the actual video creation.
  • Fluent-ffmpeg for making the configuration and execution of FFMpeg commands easy peasy.
  • @ffmpeg-installer/ffmpeg for installing the correct version of FFMpeg for the hardware this demo runs on.
  • mkdirp for creating the folder path for each client's data, including any missing nodes in the path.
@cliffhall
cliffhall / a-render-and-transmit-test.md
Last active Dec 29, 2017
A Three.js / Socket.io / Node.js render and transmit test.
View a-render-and-transmit-test.md

This example renders thirty frames of the Three.js 'your first scene' example and sends them to a Node.js microservice, which saves them to the filesystem.

test-render-client.html

  • Creates the scene, camera, renderer, and kicks off the render loop, which stops after 30 frames have been rendered.
  • As an optimization, it doesn't add the Three.js canvas to the browser DOM, rendering it offscreen, but reporting progress.
  • It extracts the data for each frame using canvas.toDataURL(), sending that to a web worker process for transmission.
  • When all frames are rendered, it sends a 'done' message to the worker.

test-render-worker.js

  • Sets up a queue for incoming frames to be sent to the server.
@cliffhall
cliffhall / a-simple-socket-io-test.md
Last active Nov 5, 2016
A simple Socket.io test with client and server (Node.js) parts.
View a-simple-socket-io-test.md
You can’t perform that action at this time.