Skip to content

Instantly share code, notes, and snippets.

View alana314's full-sized avatar

alana314

  • Ayzenberg
  • Los Angeles
View GitHub Profile
@alana314
alana314 / flashPrintrbotPlus1.1.sh
Created May 9, 2024 23:59
Flash Printrbot Plus V1.1 Firmware
#!/bin/bash
#flash printrbot plus v1.1
#make sure BOOT jumper is shorted
dfu-programmer at90usb1286 erase
dfu-programmer at90usb1286 flash unified-v3.cpp.hex
@alana314
alana314 / LaunchChecklist.txt
Created January 16, 2024 18:31
Website Production Launch Checklist
Disable browser passwords
Disable robots.txt
Add 1200 x 630 share image
Add meta tags for og:image and twitter:image
Check HTML title
Add meta title and meta description
Add favicon and app icons (I prefer https://realfavicongenerator.net/ )
Test with LinkedIn Post Inspector https://www.linkedin.com/post-inspector/inspect/
Test with Facebook Sharing Debugger https://developers.facebook.com/tools/debug/
Test with Twitter Card Validator https://cards-dev.twitter.com/validator
#!/bin/sh
#Sync and then nuke S3 Bucket and all contents
if [ $# != 1 ]; then
echo "Usage: $0 [S3-bucket-name]" >&2
exit 1
fi
echo "Sync $1 to local? Press [ENTER] to continue"
read -s < /dev/tty
aws s3 sync s3://$1 ./$1
echo "Empty bucket $1? Press [ENTER] to continue"
@alana314
alana314 / gitshowrecentbranches.sh
Created August 9, 2021 23:55
git show recent branches
#!/bin/bash
#show recent branches. You could make this file as /usr/local/bin/gitshowbranches, chmod it to execute it, and then run "gitshowbranches" to show recent branches
#based on https://stackoverflow.com/questions/5188320/how-can-i-get-a-list-of-git-branches-ordered-by-most-recent-commit
git branch --sort=-committerdate | head
@alana314
alana314 / CopyAppleMusicRecentlyAdded.js
Created February 23, 2021 01:37
Export Apple Music Recently Added Songs to File
// First go to https://music.apple.com/library/recently-added and log in
// Scroll down the page to populate more items
// Open the developer console and paste this:
copy([...document.querySelectorAll('.line')].map((l, i) => {return {'song': l.innerText, 'artist' : [...document.querySelectorAll('.line2')]?.[i]?.innerText}}))
// This copies a JSON array of songs and artists to your clipboard, paste into a blank text document
@alana314
alana314 / ffmpeg_convert_1920_29_97.sh
Created October 21, 2020 21:14
Convert and Letterbox video to 1920x1080 29.97 fps with ffmpeg
#!/bin/bash
#convert to 1080 at 29.97fps
#useful for screen capture videos with odd aspect ratios and framerates
#modified from https://superuser.com/questions/891145/ffmpeg-upscale-and-letterbox-a-video
ffmpeg -i input.mov -vf "scale=(iw*sar)*min(1920/(iw*sar)\,1080/ih):ih*min(1920/(iw*sar)\,1080/ih), pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2, fps=fps=29.97" output.mp4
@alana314
alana314 / copySoundcloudPlaylist.js
Created December 10, 2019 23:16
Copy Soundcloud Playlist to JSON
//Copies the Artist, Track and URL of a playlist to the clipboard in JSON format
//Run in console on a soundcloud page with a playlist:
copy([...document.querySelectorAll('.trackItem__content')].map(ele => {return ({'artist' : ele.querySelectorAll('a')[0].innerHTML, 'track' : ele.querySelectorAll('a')[1].innerHTML, 'url' : ele.querySelectorAll('a')[1].href})}))
//or log it:
[...document.querySelectorAll('.trackItem__content')].map(ele => {return ({'artist' : ele.querySelectorAll('a')[0].innerHTML, 'track' : ele.querySelectorAll('a')[1].innerHTML, 'url' : ele.querySelectorAll('a')[1].href})})
//Example output of my 2019 playlist:
/*
[
{
"artist": "JUST A GENT",
@alana314
alana314 / youtube-dl-mp4
Created December 5, 2019 04:58
youtube-dl-mp4 for forcing youtube-dl to download mp4
#!/bin/bash
#for OS X or linux
#place this file in /usr/local/bin/youtube-dl-mp4
#and chmod +x /usr/local/bin/youtube-dl-mp4
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' $1
@alana314
alana314 / testheadphones.sh
Created March 21, 2019 17:59
Test if headphones are plugged in -- OS X shell script
#!/bin/bash
if system_profiler SPAudioDataType | grep --quiet Headphones; then
echo plugged in
else
echo not plugged in
fi
@alana314
alana314 / autoscrollwebsite.js
Created April 20, 2018 22:55
Auto scroll website
//Paste this in console (in another window) to auto-scroll a website, useful for video capturing.
var i = 0;setInterval(function(){window.scrollTo(0, i);i = i+ 2;}, 5);