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 / 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
@earthbound19
earthbound19 / OklabExperiments.js
Last active April 6, 2024 11:10
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 / 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/

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 / 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.
@earthbound19
earthbound19 / ripDataSingingClip.txt
Created June 30, 2020 05:35
extract clip of Data singing about life forms from extracted .vob of STAR TREK: GENERATIONS DVD
ffmpeg -y -i VTS_01_3.vob -ss 00:06:07.300 -t 00:00:36.690 -map 0:v -vcodec copy -map 0:a -acodec copy out.mp4
@earthbound19
earthbound19 / keybase.md
Created July 23, 2019 04:13
proof of keybase ID

Keybase proof

I hereby claim:

  • I am earthbound19 on github.
  • I am earthbound (https://keybase.io/earthbound) on keybase.
  • I have a public key ASADgnQddBl7U3g8jIoKNm960AG5_uqHvT3DipIHxZQJego

To claim this, I am signing this object:

@earthbound19
earthbound19 / mondrian.html
Created May 9, 2018 23:01 — forked from christopherlovell/mondrian.html
D3 Mondrian Generator
<!DOCTYPE html>
<html lang="en">
<head>
<title>Mondrian Generator</title>
<script src="https://d3js.org/d3.v4.js" charset="utf-8"></script>
<style>
</style>
</head>
<body>
@earthbound19
earthbound19 / getBitcoinPurchasingPowerParity.sh
Last active July 12, 2017 18:36
Get current list of Big Mac purchasing power per Bitcoin (by average of countries and by country)
curl http://bitcoinppi.com/v1.1/spot.csv > Bitcoin_Purchasing_Power_Parity_spot.csv
curl http://bitcoinppi.com/v1.1/spot_countries.csv > Bitcoin_Purchasing_Power_Parity_spot_countries.csv
# Re: http://bitcoinppi.com/pages/api - http://bitcoinppi.com/ - https://news.bitcoin.com/bitbond-new-big-mac-index-gives-bitcoin-tangible-value-by-association/ - https://en.wikipedia.org/wiki/Big_Mac_Index
@earthbound19
earthbound19 / Our Romatic Diamond-Gemstone-Heart-300px-png-loop100x-mp4.bat
Created July 3, 2016 17:22
Commands to encode a super cheesy music file with a super cheesy looped source image, via ffmpeg
ffmpeg -y -loop 1 -f image2 -i Diamond-Gemstone-Heart-300px.png -i "Our Romatic.mp3" -shortest -r 29.97 -crf 40 1.mp4
echo file '1.mp4' > concat.txt
echo file '1.mp4' >> concat.txt
echo file '1.mp4' >> concat.txt
echo file '1.mp4' >> concat.txt
echo file '1.mp4' >> concat.txt
echo file '1.mp4' >> concat.txt
echo file '1.mp4' >> concat.txt
echo file '1.mp4' >> concat.txt