Skip to content

Instantly share code, notes, and snippets.

View earthbound19's full-sized avatar
🚀
creative coding, aiming for Art Blocks

Alex Hall earthbound19

🚀
creative coding, aiming for Art Blocks
View GitHub Profile
@earthbound19
earthbound19 / randomFloatsInRange.c
Last active July 5, 2020 00:36
C randomFloatInRange executable
// DESCRIPTION
// Generates N (argv[3]) floating point numbers in range argv[1] to argv[2]. Depending on system and setup may be able to produce ~35,000N/sec.
// USAGE
// Compile for example via gcc, like this (I use an MSYS2-MinGW-64 terminal) :
// gcc randomFloatsInRange.cpp -o randomFloatsInRange.exe
// -- and then invoke the resulting executable with these parameters (POSITIONAL, not named):
// - 1. smallest possible random number to generate. I don't know the minimum; certainly 0 is allowed.
// - 2. largest possible random number to generate. Maximum may be RAND_MAX; on my system that is: 2147483648.000000.
// - 3. how many such numbers to generate. I don't know the maximum.

The following example code, QA and release management checklist assumes a git branching model like this:

  • master branch is protected, and changes least frequently, only when develop is merged into it.
    • develop branch is protected, and changes infrequently, and ideally only when feature and release branches off it are merged into it.
      • variously named release branches, branched off develop, finalized as various feature/fix branches off it are marged into it.
        • (optional, depending on number of developers on the release and need) variously named feature/fix branches off release branches, frequently made and merged into a release branch.

Also, a kanban or similar project management series of columns like the following may help track issues through the process. QA may move failed items back from "QA this" to "coding" to signal programmers that a fix or new feature failed (with detailed notes on the failure mode) :

`backlog | up next (or current sprint) | in progress | ready for QA | QA pa

@earthbound19
earthbound19 / processing_recursive_combination_function.pde
Last active February 28, 2021 15:03
Processing (Java) recursive combination finder function, adapted
// Processing/Java example of function that prints strings of all possible combinations of size howManyToSelect from an ArrayList<Integer>.
// Also, it constructs an ArrayList of ArrayLists of integers, with is a list of all possible combinations. Because I want this
// in Processing for my prototyping and generative art purposes. Because I am insane.
// ADDENDUM: GitHub doesn't wrap the text in the viewbox despite my just setting a toggle to do so.
// To read many comments you may need to view/copy the raw source.
// Disclaimer: I could not explain how this works. I hacked a black box function I found until it did what I want.
// This is a a recursive function (it calls itself). Adapted from: https://hmkcode.com/calculate-find-all-possible-combinations-of-an-array-using-java/
// other implementations of this or other combinatronics algorithms: https://stackoverflow.com/a/29914908/1397555 -- https://www.geeksforgeeks.org/print-all-possible-combinations-of-r-elements-in-a-given-array-of-size-n/
@earthbound19
earthbound19 / OklabExperiments.js
Last active May 20, 2024 21:34
rgb <-> oklab to/from convert, color blend through oklab space
// This gist contains JavaScript functions and tests for:
// - conversion from gamma-corrected (or gamma-compressed) sRGB to linear RGB, to Oklab
// - interpolation through Oklab
// - conversion back to linear RGB, then sRGB
// To use these tests, install nodejs, save this file locally, and run with:
// node OklabExperiments.js
// No other dependencies are required to use this.
// Thanks to some helpful folks in the generative art community for helping me better understand what's happening with this.
// My toddler smacked the keyboard with a piece of cardboard and made me accidentally type:
@earthbound19
earthbound19 / wget_all_Humanae_portraits_Tumblr.sh
Created January 26, 2022 18:13
Retrieves all the HTML for all active state archives of the Humanae project (at Tumblr) which the Wayback Machine archived until 2019-07-26 , parses the large portrait JPG URLs out of all that, and retrieves all the large JPGs, in a folder.
# DESCRIPTION
# Retrieves all the HTML for all active state archives of the Humanae project (at Tumblr) which the Wayback Machine archived until 2019-07-26, parses the large portrait JPG URLs out of all that, and retrieves all the large JPGs, in a folder. Result is 3,326 portrait images. At this writing, whether any of those are duplicates has not been determined. The JPG URLs parsed out of the HTML source files have some identical file names at different URLs, and partial analysis suggests they are all in fact the same files at different web locations in Tumblr. Also, it happens at this writing that all the image URLs are still live, although the links to them at the Tumblr blog are down. Pulling images out of the Wayback machine, if that ever becomes necessary, might be more difficult.
# DEPENDENCIES
# Ruby, the wayback_machine_downloader gem, and (if you're on Windows) MSYS2. On other platforms, a Bash environment with what GNU/Linux core utils this scirpt uses. Maybe other things that Ruby may need on pl