Skip to content

Instantly share code, notes, and snippets.

View ksloan's full-sized avatar
🐛
Bug hunting

Kevin Sloan ksloan

🐛
Bug hunting
View GitHub Profile
@ksloan
ksloan / date-time.code-snippets
Created October 30, 2021 04:11
Date and Time Code Snippet
{
"Date stamp": {
"prefix": "date",
"body": "$CURRENT_YEAR_SHORT$CURRENT_MONTH$CURRENT_DATE",
"description": "Insert Date Stamp"
},
"Time stamp": {
"prefix": "time",
"body": "$CURRENT_TIME_UNIX",
"description": "Insert Time Stamp"
@ksloan
ksloan / avectorscope.sh
Created January 3, 2021 03:58
avectorscope
ffmpeg -i "The sun is in your eyes.mp3" -filter_complex \
"[0:a]avectorscope=s=3840x2160:draw=line:rc=255:gc=238:bc=0:rf=80:gf=70:bf=0:scale=sqrt:rate=60,format=yuv420p[v]" \
-map "[v]" -map 0:a output.mp4
@ksloan
ksloan / kill-audio.sh
Created October 25, 2020 15:40
Kill coreaudiod to fix Macbook sound popping issue
sudo kill -9 $(ps -ef | grep coreaudiod | grep -v grep | awk '{print $2}')
@ksloan
ksloan / install_plex_raspian.sh
Created April 9, 2020 21:43
install plex raspbian
sudo apt update
sudo apt install apt-transport-https ca-certificates curl
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
sudo apt update
sudo apt install plexmediaserver
# verify
@ksloan
ksloan / git-remove-dir.sh
Last active March 17, 2020 15:08
Remove an entire directory from git history
git filter-branch --tree-filter "rm -rf FOLDER_NAME" --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
git gc
git push origin master --force
@ksloan
ksloan / ksloan.code-snippets
Created March 9, 2020 22:17
vscode global snippets
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
"console.log": {
"scope": "javascript,typescript",
@ksloan
ksloan / rmNodeModules.sh
Created March 4, 2020 02:21
remove all node_modules
# prune to ignore nested node_modules within node_modules
rm -rf `find . -type d -name node_modules -prune`
@ksloan
ksloan / dismissNotifications.workflow
Created November 26, 2019 17:34
Dismiss Notifications Automator Script
function run(input, parameters) {
var app = Application('System Events');
app.includeStandardAdditions = true;
app.processes.byName('NotificationCenter').windows.buttons[0].click();
return input;
}
@ksloan
ksloan / mongooseChildThrowExample.js
Last active June 16, 2017 17:13
Mongoose Schema: child schema strict throw
const mongoose = require('mongoose')
const childSchema = mongoose.Schema({
name: String
}, {
strict: 'throw'
})
const parentSchema = mongoose.Schema({
children: [childSchema]
@ksloan
ksloan / ios-icon-splash-generator.sh
Created September 28, 2016 23:49
Generate Icons and Splash Screens for iOS App
convert icon.png -resize 180x180 "./icons/180.png"
convert icon.png -resize 29x29 "./icons/29.png"
convert icon.png -resize 58x58 "./icons/29-2x.png"
convert icon.png -resize 87x87 "./icons/29-3x.png"
convert icon.png -resize 40x40 "./icons/40.png"
convert icon.png -resize 80x80 "./icons/40-2x.png"
convert icon.png -resize 50x50 "./icons/50.png"
convert icon.png -resize 100x100 "./icons/50-2x.png"
convert icon.png -resize 57x57 "./icons/57.png"
convert icon.png -resize 114x114 "./icons/57-2x.png"