This file contains hidden or 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
| // Don't use dodgy NPM packages for this. It's really not that complicated to build in 2025 | |
| type GranularityInfo = { | |
| unit: Intl.RelativeTimeFormatUnit; | |
| intervalMs: number; | |
| }; | |
| const getGranularityForTimestampDiff = (diff: number): GranularityInfo => { | |
| if (diff > 86_400_000) { | |
| return { unit: "day", intervalMs: 86_400_000 }; | |
| } else if (diff > 3_600_000) { |
This file contains hidden or 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
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
This file contains hidden or 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
| // like python's range, yields numbers from start to end (not inclusive) | |
| export const range = function* (start, end, step = 1) { | |
| let index = start; | |
| while (index < end) { | |
| yield index; | |
| index++; | |
| } | |
| } | |
| // like python's enumerate, yields [index, item] |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| # Turns a provided input image ($1) into a set of tiles | |
| # for the different zoom levels required by Google Street View. | |
| # Saves them in the given directory ($2). | |
| # The images will be named `z<ZOOM_LEVEL>-i<INDEX>`. | |
| # You can multiply the Y coordinate by the "row size" at the given zoom level |
This file contains hidden or 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
| //========================================================== | |
| // CUSTOM JAVASCRIPT CONSOLE | |
| // built by jakub fiala | |
| // | |
| // this small script intercepts the standard console methods | |
| // and provides a way of accessing their messages, | |
| // as well as stack traces, which is really cool. | |
| // it formats the stack traces for popular browsers | |
| // | |
| // contributions welcome! |
This file contains hidden or 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
| export const loadShader = (context, type, source) => { | |
| const shader = context.createShader(type); | |
| // Send the source to the shader object | |
| context.shaderSource(shader, source); | |
| // Compile the shader program | |
| context.compileShader(shader); | |
| // See if it compiled successfully | |
| if (!context.getShaderParameter(shader, context.COMPILE_STATUS)) { | |
| console.error('An error occurred compiling the shaders: ' + context.getShaderInfoLog(shader)); | |
| context.deleteShader(shader); |
This file contains hidden or 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
| //Because meyda v2 doesn't really have an offline extraction API, we need to manually require some stuff | |
| var jsfft = require("./node_modules/meyda/node_modules/jsfft/") | |
| var complex_array = require("./node_modules/meyda/node_modules/jsfft/lib/complex_array.js") | |
| var extractors = require("./node_modules/meyda/dist/node/featureExtractors.js") | |
| var meyda_utils = require("meyda").utils | |
| //this is a simple class for streaming WAV data as Float32Arrays | |
| //available at https://gist.github.com/jakubfiala/cb9de100fdd4f043d46e | |
| //we're not going to use its streaming functionality for simplicity | |
| var WavManager = require("./wav-manager.js") | |
| var fs = require('fs') |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o nounset | |
| if [[ "$#" -ne 2 ]]; then | |
| echo "Usage: ./boomerang.sh src_file out_file" | |
| fi | |
| SRC=$1 | |
| OUT=$2 |
This file contains hidden or 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
| http://glslsandbox.com/e#46760.1 |
This file contains hidden or 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
| { | |
| "Badge Text" : "", | |
| "Working Directory" : "\/Users\/jakub", | |
| "Prompt Before Closing 2" : 0, | |
| "Selected Text Color" : { | |
| "Green Component" : 0, | |
| "Blue Component" : 0, | |
| "Red Component" : 0 | |
| }, | |
| "Rows" : 25, |
NewerOlder