Skip to content

Instantly share code, notes, and snippets.

View stuf's full-sized avatar

Stef stuf

View GitHub Profile
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
./ffmpeg -f image2 -pattern_type glob -i *.jpg -framerate 24 -an -vcodec libx264 clip.mp4
@stuf
stuf / ffmpeg.sh
Last active August 29, 2015 14:16
#!/bin/sh
if [ -z $EVENT ]; then echo "Event code (EVENT) required"; exit 1; fi
if [ -z $REEL ]; then echo "Reel identifier (REEL) required"; exit 1; fi
# Defaults for params
if [ -z $TAKE ]; then echo "Take identifier (TAKE) not specified, defaulting to \"A\"."; fi
# Set default resolution if none specified
if [ -z $IW ]; then IW=1920; fi
@stuf
stuf / gist:2cf9858cbfd67c62fbe1
Created March 8, 2015 21:27
what am i doing
TAKE=05 EVENT=SUMMER2012 SRC=Source/RAW/2012Summer/$TAKE \
dcraw -vz4T -q 3 $SRC/*.CR2 && \
ffmpeg -f image2 -pattern_type glob -i "$SRC/*.tiff" -r 24 \
-vf "crop=iw:iw/(1920/1080):0:(ih/2)-((iw/(1920/1080))/2),setdar=dar=16/9,setsar=1:1" \
-an -r 24 -vcodec prores -profile:v 2 -pix_fmt yuv444p10 ./$EVENT-$TAKE.mov
#!/bin/sh
# Set default resolution if none specified
if [ -z $IW ]; then IW=1920; fi
if [ -z $IH ]; then IH=1080; fi
if [ -z $OUTPATH ]; then OUTPATH="."; fi
IN=Source/$EVENT/$REEL/$INFILE
OUT=$EVENT-$REEL-$TAKE.mov

A shim for your pleasure, so that in case you have to attach Angular model directives to form fields (without clearing the initial value) that are also being used in .NET WebForms.

angular.module('MyApp', [])
	.run(function () {
		 var d = document.querySelectorAll('input[type="text"]');
		 for (var i = d.length; i-- > 0;) {
		 	var e = d[i];
			if (e.hasAttribute('ng-model') && e.value != null && e.value != 0) {
 var model = e.getAttribute('ng-model');
.run(function () {
var d = document.querySelectorAll('input[type="text"]');
for (var i = d.length; i-- > 0;) {
var e = d[i];
if (e.hasAttribute('ng-model') && this.value != null && this.value != 0) {
var model = this.getAttribute('ng-model');
if (!(model === 'selectedProduct' || model === 'selectedVariation')) {
e.setAttribute('ng-init', (e.getAttribute('ng-model') + ' = "' + this.value + '"'));
}
}
(function () {
var
noop = function () {},
args = [
'log', 'info', 'warn', 'error', 'debug', 'trace', 'dir', 'group', 'groupCollapsed',
'groupEnd', 'time', 'timeEnd', 'profile', 'profileEnd', 'dirxml', 'assert',
'count', 'markTimeline', 'timeStamp', 'clear'
];
if (!('console' in window)) {
gulp.task('browserify', function () {
gulp.src('./src/Application.coffee', { read: false })
.pipe(browserify({
transform: ['coffeeify'],
extensions: ['.coffee'],
debug: !gulp.env.production
}))
.on('error', logErr)
.pipe(rename('app.js'))
.pipe(gulp.dest('./dist/scripts'));
@stuf
stuf / app.js
Created September 24, 2014 13:55
'use strict';
var express = require('express');
var logger = require('morgan');
var bodyParser = require('body-parser');
var fs = require('fs');
var util = require('util');
var http = require('http');
var Q = require('q');