Skip to content

Instantly share code, notes, and snippets.

View fredeerock's full-sized avatar

Derick Ostrenko fredeerock

View GitHub Profile
@fredeerock
fredeerock / dcp-ing.sh
Last active September 13, 2018 18:59
DCP playback and conversion with ffmpeg
# Playing
## Slow Machines
ffmpeg -lowres 2 -ss 0 -r 24 -i MOVIE.MOV -ss 0 -i AUDIO.WAV -ac: 2 -c:v mpeg2video -f avi - | ffplay -
## Fast Machines
ffmpeg -lowres 0 -ss 0 -r 24 -i MOVIE.MOV -ss 0 -i AUDIO.WAV -c:a copy -f avi - | ffplay -
# Converting
@fredeerock
fredeerock / optimizeJPG.sh
Last active December 4, 2018 23:06
Optimize JPGs for web
#!/bin/bash
# First cd into directory with images and copy/paste each line one at a time.
for i in *.jpg; convert "$i" -verbose -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB -resize 2000x2000\> "$i";
for i in *.JPG; convert "$i" -verbose -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB -resize 2000x2000\> "$i";
for i in *.jpeg; convert "$i" -verbose -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB -resize 2000x2000\> "$i";
for i in ./**/*.jpg; do convert "$i" -verbose -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB -resize 2000x2000\> "$i"; done;
for i in ./**/*.JPG; do convert "$i" -verbose -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB -resize 2000x2000\> "$i"; done;
for i in ./**/*.jpeg; do convert "$i" -verbose -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB -resize 2000x2000\> "$i"; done;
@fredeerock
fredeerock / docker_cleanup.md
Last active May 19, 2020 04:05
clean up docker

Stop all containers:

  • docker ps -aq | xargs docker stop

Remove all containers:

  • docker ps -aq | xargs docker rm

Remove all images:

  • docker images -aq | xargs docker rmi

Remove all networks:

@fredeerock
fredeerock / billboard.mel
Created November 6, 2017 15:58
Billboarding in Maya
aimConstraint -offset 0 0 0 -weight 1 -aimVector 0 0 -1 -upVector 0 1 0 -worldUpType "vector" -worldUpVector 0 1 0 -skip x -skip z CAMERA GEOMETRY;
@fredeerock
fredeerock / callbackExample.js
Last active April 12, 2017 19:38
Super simple Callback Example
function one(callback){
console.log("one");
callback();
}
function two(callback){
console.log("two");
callback();
}
@fredeerock
fredeerock / p5setup.sh
Last active April 6, 2017 05:47
quickly setup p5.js with serial
#!/bin/bash
FOLDER=$1
mkdir -p $FOLDER
cd $FOLDER
printf "Downloading p5.js......"; curl -LO `curl -s https://api.github.com/repos/processing/p5.js/releases | grep browser_download_url | head -n 4 | grep p5.min.js | cut -d '"' -f 4`; echo "done.";
printf "Downloading p5.serialport......"; curl -LO https://raw.githubusercontent.com/vanevery/p5.serialport/master/lib/p5.serialport.js; echo "done.";
printf "<!doctype html>\n<title>p5tests</title>\n<script src=\"p5.min.js\"></script>\n<script src=\"p5.serialport.js\"></script>\n<script src=\"sketch.js\"></script>" > index.html
printf "function setup() {\n\n}\n\nfunction draw() {\n\n}" > sketch.js
printf "{\n \"name\": \"serialserver\",\n \"version\": \"1.0.0\",\n \"scripts\": {\n \"start\": \"./node_modules/p5.serialserver/startserver.js\"\n }\n}" > package.json
npm install p5.serialserver
@fredeerock
fredeerock / index.html
Last active May 10, 2019 17:39
Short valid html file
<!doctype html>
<title>.</title>
<p>lo
@fredeerock
fredeerock / Keybase proof.md
Created August 2, 2016 03:12
My publicly-auditable identity

Keybase proof

I hereby claim:

  • I am fredeerock on github.
  • I am fredeerock (https://keybase.io/fredeerock) on keybase.
  • I have a public key whose fingerprint is 9CE9 3A05 F2C0 56B1 3143 5DB5 5356 6C34 9AD2 7695

To claim this, I am signing this object:

@fredeerock
fredeerock / dabblet.css
Created February 9, 2015 18:38
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@fredeerock
fredeerock / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console