This file contains hidden or 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
n=(l='▁▂▃▄▅▆▇█'.split(''),x=new AudioContext(),d=new Uint8Array(16),a=x.createAnalyser()).fftSize=32 | |
navigator.mediaDevices.getUserMedia({audio:1}).then(s=>{x.createMediaStreamSource(s).connect(a) | |
setInterval(_=>{a.getByteFrequencyData(d) | |
location.hash=[...d].map(v=>l[0|v/n]).join('')},n)}) |
This file contains hidden or 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
# I'm sure there's a simple way to do this without intermediate files but :shrug: | |
# transpose=1 rotates 90 degrees. | |
# fade=in:120:60 adds a fade from 4s - 5s, since it's 30fps. | |
# the fade is placed there because later we crop the video and audio 4s: -ss 00:00:04. -shortest clips the output to the end of the video, not the whole song duration. | |
ffmpeg -i IMG_5965.mov -vf "transpose=1,fade=in:120:60" output_rotated.mov && ffmpeg -i output_rotated.mov -i ~/Downloads/soul_vibration.mp3 -ss 00:00:04 -shortest output_audio.mov && ffmpeg -i output_audio.mov -codec copy -shortest -c copy -map 0 -segment_time 00:00:10 -f segment -reset_timestamps 1 output%03d.mov && rm output_rotated.mov output_audio.mov |
This file contains hidden or 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
// Author: rileyjshaw | |
// Title: Linear gradient | |
#ifdef GL_ES | |
precision mediump float; | |
#endif | |
uniform vec2 u_resolution; | |
uniform vec2 u_mouse; | |
uniform float u_time; |
This file contains hidden or 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
// A bunch of tools exist for downloading Instagram photos | |
// (eg. chrome.google.com/webstore/detail/olkpikmlhoaojbbmmpejnimiglejmboe) | |
// but not as many grab your captions. This is quick and dirty, in the spirit of | |
// https://gist.github.com/rileyjshaw/953b3aba4c48e34b0069152f5fc21e4c. | |
// In your browser of choice, open up the Web Console and paste in the following. | |
// You might need to change some `querySelector` calls to match the Instagram web | |
// client's current markup. | |
// Fragile! Based on a generated classname. Replace this with whatever selector |
This file contains hidden or 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
for match in $(egrep -roi '([_a-z])+: function' javascript | cut -d : -f 1-2); do | |
file=`echo $match | cut -d : -f 1` | |
fn=`echo $match | cut -d : -f 2` | |
count=`grep -r $fn javascript | wc -l` | |
if [[ $count -lt 2 ]]; then | |
echo "$file:$fn" | |
fi | |
done |
This file contains hidden or 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
/** | |
* STEP 1: Go to https://www.tumblr.com/mega-editor/<your-blog-name> | |
* STEP 2: Open your developer console | |
* STEP 3: Paste this snippet in | |
* STEP 4: Hit enter twice | |
* STEP 5: Repeat from STEP 2 until everything is deleted | |
* | |
* Deletes 100 at a time due to tumblr restrictions. | |
*/ | |
Array.from(document.querySelectorAll('.overlay')).slice(-100).forEach(el => el.click()); |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "twitter" | |
require "json" | |
require "faraday" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
# get these from dev.twitter.com |
This file contains hidden or 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
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
This file contains hidden or 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
// In Chrome, go to your profile page. Open the Developer Tools Console | |
// (cmd + alt + j) and click the mobile phone button in the top left ("Toggle | |
// device toolbar"). I did this because it's easier to get around whatever | |
// guards are in place without worrying about hover states, etc. | |
// | |
// I chose "iPhone 5" in the device menu at the top of the browser window. That | |
// might be important, but probably not. I only ran this once ¯\_(ツ)_/¯ | |
// | |
// Refresh the page, scroll down so you can see your posts, paste this into the | |
// console, hit enter, and enjoy the show for 20 seconds until it comes to a |
This file contains hidden or 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
#!/usr/bin/env python | |
"""Find scientific notation in a file and switch each occurrence to floats.""" | |
import argparse | |
import re | |
# Example usage: `./fix_notation.py hologram.ngc hologram_fixed.ngc -p 8` | |
parser = argparse.ArgumentParser(description='Find scientific notation in a file and switch each occurrence to floats.') | |
parser.add_argument('input_file', type=str) | |
parser.add_argument('output_file', type=str) |