Skip to content

Instantly share code, notes, and snippets.

View RepComm's full-sized avatar

Jonathan Crowder RepComm

View GitHub Profile
@kitsonk
kitsonk / bronto.ts
Last active August 10, 2022 12:03
Example Deno Static Server
import {
green,
cyan,
bold,
yellow,
red
} from "https://deno.land/std@v0.20.0/fmt/colors.ts";
import {
Application,
@RabaDabaDoba
RabaDabaDoba / ANSI-color-codes.h
Last active July 20, 2024 00:58 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes working in C!
/*
* This is free and unencumbered software released into the public domain.
*
* For more information, please refer to <https://unlicense.org>
*/
//Regular text
#define BLK "\e[0;30m"
#define RED "\e[0;31m"
#define GRN "\e[0;32m"
@aldemirenes
aldemirenes / android_build_run.sh
Last active May 4, 2023 10:27
Shell scripts for Android development without needing to use Android Studio
#!/bin/sh
package_name=$1
./gradlew assembleDebug
adb -d install -r app/build/outputs/apk/app-debug.apk
adb shell monkey -p "$package_name" -c android.intent.category.LAUNCHER 1
./logcat.sh "$package_name"
@mbitsnbites
mbitsnbites / fft.js
Created May 5, 2016 20:34
Tiny FFT implementation in JavaScript
// This is a tiny radix-2 FFT implementation in JavaScript.
// The function takes a complex valued input signal, and performs an in-place
// Fast Fourier Transform (i.e. the result is returned in x_re, x_im). The
// function arguments can be any Array type (including typed arrays).
// Code size: <300 bytes after Closure Compiler.
function FFT(x_re, x_im) {
var m = x_re.length / 2, k, X_re = [], X_im = [], Y_re = [], Y_im = [],
a, b, tw_re, tw_im;
for (k = 0; k < m; ++k) {
@samsartor
samsartor / ElytraModel.java
Last active May 13, 2024 02:08
Code for simulating the elytra item in Minecraft
/**
* An accurate simulation of the elytra item as of Minecraft 15w41b
*/
public class ElytraModel
{
public int glideTime;
public int damageTaken;
public double posX;
public double posY;
@lrvick
lrvick / bitcolor.js
Created March 18, 2012 20:02
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){