This file contains 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
''' | |
Two Number Guessing Game: | |
-Player 1 picks two random numbers, A and B. In reality they can be any two real numbers. | |
In python we run into trouble with numbers larger than 2,147,483,647 due | |
to 32 bit arithmetic, so we'll bound the limits here. | |
-Player 2 can see one of the two numbers. | |
-Player 2 then has to decide which number is larger. | |
It seems like it would be a random chance. Regardless of what number A is, | |
there's an infinite amount of numbers greater than, and an infinte amount of |
This file contains 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
// Processing 3 sketch: Used on Raspberry Pi with 7" touchscreen. | |
// Touchscreen tracks XY position of finger and sends as serial data over | |
// bluetooth. That data is received by MaxMSP patch and used to control | |
// cutoff frequency and resonance of audio filters, real time. | |
import processing.serial.*; | |
Serial port; | |
int val = 0; | |
int valueScale = 128; |
This file contains 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
#!/bin/bash | |
for i in *.mkv; do ffmpeg -i "$i" -c:v libx264 -crf 23 -preset medium -movflags +faststart -vf scale=-1:1080,format=yuv420p -ac 2 "${i%.*}.mp4"; done |
This file contains 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
#!/bin/bash | |
for i in *.mov; do ffmpeg -i "$i" -c:v libx264 -crf 23 -preset medium -movflags +faststart -vf scale=-1:1080,format=yuv420p -ac 2 "${i%.*}.mp4"; done |
This file contains 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
#Simultaneously create and switch to new directory | |
function mkcd () { mkdir -p "$@" && cd "$@"; } | |
#Repleace spaces in filenames in a directory with an underscore | |
function repspace () { find . -type f -name "* *" -exec bash -c 'mv "$0" "${0// /_}"' {} ";" ; } | |
#Prompt | |
PS1="%F{cyan}%n:%1~$%f " | |
autoload -Uz compinit && compinit |
This file contains 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
/** | |
* Sketch for Arduino Nano 33 IoT | |
* | |
* Connects to WiFi network and uses UDP to send | |
* onboard sensor data. | |
* | |
* Sensors: 3D Gyro and 3D accelerometer (6 values) | |
* Sensor values are Floats cast to a byte array. | |
* They must be recast to Float on the remote device | |
* receiving the UDP data. |
This file contains 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
/* | |
Put this somewhere in the Juce app (ie. the MainComponent ctor). | |
When you build in debug, it prints to console all the files in BinaryData | |
that aren't being used in your code. | |
*/ | |
DBG(" "); | |
auto SourceDir = juce::File("~/ /*ABSOLUTE/PATH/TO/SOURCE/DIRECTORY/GOES/HERE*/"); |
This file contains 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
/* | |
Put somewhere in Juce app (ie. ctor of MainComponent) and run app. Will | |
print to console the name of the header files that don't have an #include | |
in the code other than in their corresponding .cpp file. | |
*/ | |
DBG(" "); | |
auto sourceDir = juce::File("~/Rode/RodeCentral/rode_central/RODE Central/Source"); |
This file contains 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
Just a collection of functions i add to my .bash_profile (mac) and .bashrc (linux) on almost every device i have. | |
# Simultaneously create and switch to new directory | |
function mkcd () { mkdir -p "$@" && cd "$@"; } | |
# Simultaneously change into directory and list files | |
function cdls () { cd "$@" && ls -ah "."; } | |
# Repleace spaces in filenames in a directory with an underscore |
This file contains 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
''' | |
opens midi connection | |
takes midi notes from source (for example, your DAW) | |
finds the octaves of those notes beyond the range of human hearing until octave of note is within visible light range | |
converts frequency of the color octave to wavelength | |
approximates RGB value for color of note | |
displays color of note in window | |
''' | |
import rtmidi |
OlderNewer