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 | |
#flash printrbot plus v1.1 | |
#make sure BOOT jumper is shorted | |
dfu-programmer at90usb1286 erase | |
dfu-programmer at90usb1286 flash unified-v3.cpp.hex |
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
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 |
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/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" |
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 | |
#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 |
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
// 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 |
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 | |
#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 |
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
//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", |
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 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 |
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 | |
if system_profiler SPAudioDataType | grep --quiet Headphones; then | |
echo plugged in | |
else | |
echo not plugged in | |
fi |
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
//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); |
NewerOlder