Skip to content

Instantly share code, notes, and snippets.

View plasticrake's full-sized avatar

Patrick Seal plasticrake

View GitHub Profile
@adammhaile
adammhaile / FastLEDDisk.ino
Last active November 27, 2020 03:11
Examples of using angle and radius to select pixels on a circular pixel layout using FastLED
#include "FastLED.h"
#define NUM_LEDS 255
#define DATA_PIN SPI_DATA
#define CLOCK_PIN SPI_CLOCK
// Define the array of leds
CRGB leds[NUM_LEDS];
@justmoon
justmoon / custom-error.js
Last active April 22, 2024 17:19 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);
@nbeloglazov
nbeloglazov / rhino_script.js
Last active July 11, 2020 22:05
setTimeout, clearTimeout, setInterval, clearInterval implementations for Rhino that works in 1.7R4
var setTimeout, clearTimeout, setInterval, clearInterval;
(function () {
var executor = new java.util.concurrent.Executors.newScheduledThreadPool(1);
var counter = 1;
var ids = {};
setTimeout = function (fn,delay) {
var id = counter++;
var runnable = new JavaAdapter(java.lang.Runnable, {run: fn});