Skip to content

Instantly share code, notes, and snippets.

👨‍🚀
🖌

Glenn Batuyong 47ronin

👨‍🚀
🖌
Block or report user

Report or block 47ronin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@47ronin
47ronin / youtube-dlbest.sh
Last active Apr 6, 2018
Use youtube-dl to merge best video and best audio formats together into an MPEG-4 container
View youtube-dlbest.sh
#!/bin/bash
# $1 is the URL
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4' $1
@47ronin
47ronin / combineMP4videos.sh
Created Nov 8, 2017
Concatenate similar MP4 videos together into one, long video
View combineMP4videos.sh
#!/bin/bash
ffmpeg -f concat -safe 0 -i <(for f in ./*.mp4; do echo "file '$PWD/$f'"; done) -c copy output.mp4
@47ronin
47ronin / audiovideo_offset.sh
Created Oct 1, 2017
Offsets video track by a specific duration to properly sync with embedded audio, creates a remuxed output file
View audiovideo_offset.sh
#!/bin/bash
ffmpeg -i ScrewedUpVideo.mp4 -itsoffset 0.33 -i ScrewedUpVideo.mp4 -vcodec copy -acodec copy -map 0:1 -map 1:0 FixedVideo.mp4
@47ronin
47ronin / ISO8601_RenameJPGs.sh
Last active Sep 5, 2017
Rename all JPG files in a path using IPTC/EXIF capture date in ISO 8601 format, plus capture time as a unique serial ID
View ISO8601_RenameJPGs.sh
jhead -n%Y%m%d-%H%M%S *.jpg
@47ronin
47ronin / removeMACOSXdotfiles.sh
Created Nov 21, 2016
Simple removal of macOS dotfiles from a path, usually external volumes
View removeMACOSXdotfiles.sh
find /path/to -name "._*" -o -name ".DS_Store" | sed 's/.*/"&"/' | xargs rm -v
@47ronin
47ronin / download_website.sh
Created Jul 18, 2016
Simple command to download a static copy of a website
View download_website.sh
#!/bin/bash
# Be sure to remove all metric gathering scripts like Google Analytics
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent https://someURL
@47ronin
47ronin / angularJS1x_promise_main.js
Last active Jul 18, 2016
AngularJS 1.x gather data from promise and do amazing shit
View angularJS1x_promise_main.js
'use strict';
angular.module('someApp')
.controller('MainCtrl',
['$scope', '$http', '$moment', '$q',
function ($scope, $http, $moment, $q) {
var bunchOfShit = 'value',
moreShit = 'anotherValue',
shitURL = 'https://someurl/' + bunchOfShit + '?callback=JSON_CALLBACK',
shitStormURL = 'https://anotherwebsite/' + moreShit + '?callback=JSON_CALLBACK',
dataShit = $http.jsonp(shitURL),
@47ronin
47ronin / bash_find_filenames.sh
Last active Jul 18, 2016
BASH command to recursively search current directory for filenames containing string; case-insensitive, ending with specific extension
View bash_find_filenames.sh
#!/bin/bash
find . -iname "*string*.jpg"
@47ronin
47ronin / SocialProfilesSchemaJSON.js
Last active Oct 23, 2015
JSON Structured Data Schema for Port of San Diego Social Profiles (Google). See https://developers.google.com/structured-data/customize/social-profiles
View SocialProfilesSchemaJSON.js
<script type="application/ld+json">
{
"@context":"http://schema.org",
"@type":"Organization",
"name":"Port of San Diego",
"url":"https://www.portofsandiego.org",
"logo":"https://www.portofsandiego.org/templates/yoo_sync/styles/SDUPD/images/logo-sdupd.png",
"contactPoint":[
{
"@type":"ContactPoint",
You can’t perform that action at this time.