Skip to content

Instantly share code, notes, and snippets.

View earthbound19's full-sized avatar
๐Ÿš€
creative coding

Alex Hall earthbound19

๐Ÿš€
creative coding
View GitHub Profile
@earthbound19
earthbound19 / python: center-aligned columns of string images in a row.txt
Last active August 29, 2015 13:57
Render a horizontal series of multiples of a number, each centered along a grid width, with a font of your choice.
#See "TO CHANGE THE OUTPUT IMAGE, CHANGE THESE VARIABLES," below.
#Render a series of string multiples of a number, each horizontally centered along a tile-length grid; using a font of our choice.
#Started 2014-03-15 (Sat Mar 15) 04.53.40 PM RAH
#Horked and extended from:
#http://stackoverflow.com/questions/15857117/python-pil-text-to-image-and-fonts
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
import math
@earthbound19
earthbound19 / mediaWikiColorTableSort.sh
Last active January 30, 2016 04:54
Sorts mediaWiki color tables descending in HSL values, using Cygwin (~'nix) sed and sort.
# DESCRIPTION
# Sorts mediaWiki color tables by priority of columns H(ue), S(aturation), L(ightness), descending, using Cygwin (~'nix) sed and sort.
# USAGE
# Call this script with one parameter, being the text file to sort, *inline* -- meaning, THIS WILL DIRECTLY MODIFY whatever text file you pass to it.
## CODE
if [ -a $1_.bk ]
then
echo ~-~-~-~- Backup of input file $1 already exists. Will not execute. Check if the file you passed to this script is already in the state you wish. If not, delete the backup file and run this script against $1 again. ~-~-~-~-
else
@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
@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 / 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 / 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 / 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 / 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 July 19, 2024 05:00
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/