Skip to content

Instantly share code, notes, and snippets.

View joshluongo's full-sized avatar
👨‍💻

Josh Luongo joshluongo

👨‍💻
View GitHub Profile
@joshluongo
joshluongo / laravel-update
Created November 9, 2022 00:55
Laravel Post Update
#!/bin/bash
composer dump-autoload
php artisan clear-compiled
# Vite
if [[ -d "node_modules/" ]]
then
npm run build
fi
@joshluongo
joshluongo / ffthumbs.sh
Created December 18, 2020 02:22
FFMPEG Thumbnail Generator
#!/bin/bash
# Loop.
for a in `find . -type f \( -iname \*.dv -o -iname \*.mp4 -o -iname \*.mkv \) -not -path '*/\.*'`; do
# Generate thumbs
echo "Processing: $a"
ffmpeg -hide_banner -loglevel fatal -y -ss "$(bc -l <<< "$(ffprobe -loglevel error -of csv=p=0 -show_entries format=duration "$a")*0.5")" -i "$a" -vf yadif -frames:v 1 "$a.jpg"
done
@joshluongo
joshluongo / Block Airplay.mobileconfig
Created July 26, 2020 06:32
Disable/Block AirPlay in macOS/iOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>PayloadDescription</key>
<string>Configures AirPlay settings</string>
<key>PayloadDisplayName</key>
@joshluongo
joshluongo / workaround.swift
Created September 20, 2019 05:27
iOS 13 Partial Navigation Bar Clipping Fix
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated);
// Workaround for FB7300235
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationController?.navigationBar.prefersLargeTitles = false
}
@joshluongo
joshluongo / jira-git.sh
Created July 21, 2017 01:52
JIRA Git Commit/Push
#!/bin/bash
# Get JIRA Project ID.
PROJECT_ROOT=`git rev-parse --show-toplevel`
JIRA_PREFIX=`cat "$PROJECT_ROOT/.jiraid"`
# Status
git status
# Get JIRA ID
@joshluongo
joshluongo / post2state.js
Last active June 8, 2016 01:11
Australian Postcode to State - Demo https://jsfiddle.net/7o772r4s/4/
// Data from https://en.wikipedia.org/wiki/Postcodes_in_Australia
function postcodeToState(input) {
// Convert.
var postcode = parseInt(input);
// Is valid.
if (isNaN(postcode) || postcode > 9999 || postcode < 100) {
return "Invalid postcode";
}
@joshluongo
joshluongo / Commands.xml
Last active October 18, 2020 18:24
Sony BRAVIA KDL-55EX720 Remote Commands
<?xml version="1.0"?>
<remoteCommandList>
<command name="Confirm" type="ircc" value="AAAAAQAAAAEAAABlAw=="/>
<command name="Up" type="ircc" value="AAAAAQAAAAEAAAB0Aw=="/>
<command name="Down" type="ircc" value="AAAAAQAAAAEAAAB1Aw=="/>
<command name="Right" type="ircc" value="AAAAAQAAAAEAAAAzAw=="/>
<command name="Left" type="ircc" value="AAAAAQAAAAEAAAA0Aw=="/>
<command name="Home" type="ircc" value="AAAAAQAAAAEAAABgAw=="/>
<command name="Options" type="ircc" value="AAAAAgAAAJcAAAA2Aw=="/>
<command name="Return" type="ircc" value="AAAAAgAAAJcAAAAjAw=="/>