Skip to content

Instantly share code, notes, and snippets.

View alfg's full-sized avatar

Alfred Gutierrez alfg

  • NBCUniversal / PeacockTV
  • ☀️ Los Angeles, CA
  • 07:31 (UTC -07:00)
View GitHub Profile
@alfg
alfg / pkg_cheatsheet.md
Created April 7, 2021 21:36
Working with Apple pkgs

Mac Packaging Cheatsheet

Create a component pkg from a DMG

pkgbuild --component /Volumes/ApplicationName/*.app --install-location \
    /Applications ApplicationName-Version.pkg

Install pkg from command line

@alfg
alfg / aac_parser.py
Created January 29, 2021 08:36 — forked from yohhoy/aac_parser.py
Parse AAC/ADTS header
#!/usr/bin/env python3
import sys
import struct
if len(sys.argv) < 2:
print("Usage: aac_parer.py <target.aac>")
exit()
aacfile = open(sys.argv[1], 'rb')
frame_no = 1
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@alfg
alfg / gist:8bbfc5f7794492b1f007a8d6bd8569cb
Created September 5, 2020 02:18 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@alfg
alfg / ffmpeg.txt
Created October 30, 2017 00:31 — forked from gildotdev/ffmpeg.txt
ffmpeg cli commands
## extract audio from .avi as .aac (conversion from another audio codec)
ffmpeg -i foo.avi -acodec aac -ab 128k -strict experimental bar.aac
## extract audio from .avi as .mp3 (no conversion, just copy)
ffmpeg -i foo.avi -acodec copy bar.mp3
## convert .mp3 to .aac
ffmpeg -i foo.mp3 -acodec aac -ab 128k -strict experimental bar.aac
## extract single frame as image from .mp4
@alfg
alfg / golang_job_queue.md
Created July 3, 2017 20:49 — forked from harlow/golang_job_queue.md
Job queues in Golang
@alfg
alfg / auth.go
Created October 27, 2015 22:30 — forked from tristanwietsma/auth.go
Golang web server example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
@alfg
alfg / gulpfile.js
Created October 20, 2015 18:36 — forked from adamrneary/gulpfile.js
Sample gulpfile for pushing functions to Lambda
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var rename = require('gulp-rename');
var install = require('gulp-install');
var zip = require('gulp-zip');
var AWS = require('aws-sdk');
var fs = require('fs');
var runSequence = require('run-sequence');
@alfg
alfg / .jshintrc.js
Last active August 29, 2015 14:27 — forked from connor/.jshintrc.js
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@alfg
alfg / runinenv.sh
Created April 20, 2012 19:25 — forked from parente/runinenv.sh
run a command in virtualenv, useful for supervisord
#!/bin/bash
VENV=$1
if [ -z $VENV ]; then
echo "usage: runinenv [virtualenv_path] CMDS"
exit 1
fi
. ${VENV}/bin/activate
shift 1
echo "Executing $@ in ${VENV}"
exec "$@"