This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let rects = []; | |
function visualize(analyser) { | |
analyser.fftSize = 2048; | |
var bufferLength = analyser.fftSize; | |
var dataArray = new Uint8Array(bufferLength); | |
function run() { | |
analyser.fftSize = 2048; | |
var bufferLengthAlt = analyser.frequencyBinCount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hexToHSL(H, off) { | |
// Convert hex to RGB first | |
let r = 0, | |
g = 0, | |
b = 0; | |
if (H.length == 4) { | |
r = "0x" + H[1] + H[1]; | |
g = "0x" + H[2] + H[2]; | |
b = "0x" + H[3] + H[3]; | |
} else if (H.length == 7) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const drawille = require('drawille') | |
const bunny = require('bunny') | |
const glmatrix = require('gl-matrix') | |
const width = 200 | |
const height = 200 | |
const canvas = new drawille(width, height) | |
const mat4 = glmatrix.mat4 | |
const vec3 = glmatrix.vec3 | |
let points = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Based on https://gist.github.com/enjalot/2904124 (in Python 2) -> quick-migrated to Python 3 | |
Usage: python server-cors | |
''' | |
import http.server as httpserver | |
class CORSHTTPRequestHandler(httpserver.SimpleHTTPRequestHandler): | |
def send_head(self): | |
"""Common code for GET and HEAD commands. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Automatically turn off a system if no ssh connection is found in last 1hr | |
set -e | |
if last | grep "still logged in";then | |
exit 0 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
test "" = "$(cat "$1" | head -n 1 | grep -v '^\[.*\]\ .*')" || { | |
FOLDER=$(git diff --name-only --cached | sed 's|/.*||' | uniq -c | sort | awk '{print $2}' | sed 1q) | |
echo "[$FOLDER] $(cat "$1")" | |
echo "[$FOLDER] $(cat "$1")" > "$1" | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from colour import Color | |
def to_hex_string(color: list) -> str: | |
c = Color(hsl=tuple(color)) | |
return c.hex | |
def to_hsl(color: str): | |
color = Color(color) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
test "" = "$(cat "$1" | head -n 1 | grep -v '^\[.*\]\ .*')" || { | |
echo >&2 "Commit message format is: [git] added new commit message hook" | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
parser: 'babel-eslint', | |
env: { | |
browser: true, | |
es6: true, | |
}, | |
extends: ['eslint:recommended', 'plugin:react/recommended'], | |
parserOptions: { | |
ecmaFeatures: { | |
experimentalObjectRestSpread: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
}, | |
extends: ['eslint:recommended', 'plugin:react/recommended'], | |
parserOptions: { | |
ecmaFeatures: { | |
experimentalObjectRestSpread: true, | |
jsx: true, |