Skip to content

Instantly share code, notes, and snippets.

View NewLunarFire's full-sized avatar

Tommy Savaria NewLunarFire

View GitHub Profile
@NewLunarFire
NewLunarFire / orgb.html
Created March 10, 2020 15:34
oRGB color picker demo
<html>
<head>
<title>oRGB demo</title>
<meta charset="utf-8" />
<style type="text/css">
#square {
border: 1px solid black;
height: 500px;
width: 500px;
background-color: black;
@NewLunarFire
NewLunarFire / ResourceScanner.java
Created January 24, 2020 18:13
Classpath Resource Scanner
package com.radiumstudio;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
public class ResourceScanner {
private static void getResourceFiles(String path) throws IOException {
try (
@NewLunarFire
NewLunarFire / helloworld.ts
Created August 3, 2018 15:05
Hello World for deno
console.log("Hello deno!");
@NewLunarFire
NewLunarFire / filter.py
Created July 13, 2017 22:45
Filter Design functions in Python
# This Python file uses the following encoding: utf-8
from numpy import abs, angle, poly, pi
from scipy import signal, zeros
import matplotlib.pyplot as plt
def freqz(b, a):
w, h = signal.freqz(b, a)
plt.figure()
plt.subplot(211)
@NewLunarFire
NewLunarFire / classdump.java
Created March 7, 2017 20:56
Dump Class Info
private String dumpClassInfo(Class<? extends Object> clazz) {
StringBuffer buffer = new StringBuffer();
while(clazz != null) {
String clazzName = clazz.getSimpleName();
int start = (40 - clazzName.length()) / 2;
buffer.append("================= Name =================\n");
for(int i = 0; i < start; i++)
buffer.append(' ');

Keybase proof

I hereby claim:

  • I am newlunarfire on github.
  • I am tommysavaria (https://keybase.io/tommysavaria) on keybase.
  • I have a public key ASCSgPqFvQTiDAI8nVD4y1FW-8zbFhJsLueBJe616bBODgo

To claim this, I am signing this object:

@NewLunarFire
NewLunarFire / waitfor.groovy
Last active July 8, 2016 12:55
Wait for a condition to become true, exiting after a specified timeout (in milliseconds)
/* Usage: waitFor(time) { condition }
Loops over the condition, waiting for it to be true. If the condition becomes true before the timeout (in milliseconds)
expires, the function quits immediately and returns true. If the condition is still false as the timeout expires, the
function returns false.
*/
waitFor = { time, closure ->
start = System.currentTimeMillis()
while(System.currentTimeMillis() - start < time)