This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmpeg -i Chapter3.mp4 -vn -acodec copy Chapter3.m4a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'pp' | |
require 'fileutils' | |
require 'escape' | |
@TARGET = ARGV[0] | |
File.delete(@TARGET) if File.exists?(@TARGET) | |
def formatTime(dur) | |
ms = ((dur.round(3) - dur.truncate())*1000).to_i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HandBrakeCLI -e x264 --vb 300 --aencoder ca_haac -B 32 -i input -o output | |
find . -name "*avi" -print \ | |
-exec ffmpeg -vn -acodec pcm_s16le -i {} /tmp/ffmpeg.wav \; \ | |
-exec afconvert -d aacp -b 32000 -f m4af -v -c 2 {} \; \ | |
-exec rm /tmp/ffmpeg.wav \; \ | |
ffmpeg -vn -acodec pcm_s16le -i /tmp/ffmpeg.wav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
find . -name "*mp3" -print -exec afconvert -d aacp -b 32000 -f m4af -v -c 1 {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tom = Person.create({ | |
name: "Tom Dale", | |
helloWorld: function() { | |
this.say("Hi my name is " + this.get('name')); | |
} | |
}); | |
tom.helloWorld() // alerts "Hi my name is Tom Dale" | |
var yehuda = Person.create({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tom = Person.create({ | |
name: "Tom Dale", | |
helloWorld: function() { | |
this.say("Hi my name is " + this.get('name')); | |
} | |
}); | |
tom.helloWorld() // alerts "Hi my name is Tom Dale" | |
var yehuda = Person.create({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.president = Ember.Object.create({ | |
firstName: "Barack", | |
lastName: "Obama", | |
fullName: function() { | |
return this.get('firstName') + ' ' + this.get('lastName'); | |
// Tell Ember that this computed property depends on firstName | |
// and lastName | |
}.property('firstName', 'lastName') | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp.president = Ember.Object.create({ | |
name: "Barack Obama" | |
}); | |
MyApp.country = Ember.Object.create({ | |
// Ending a property with 'Binding' tells Ember to | |
// create a binding to the presidentName property. | |
presidentNameBinding: 'MyApp.president.name' | |
}); | |
// Later, after Ember has resolved bindings... | |
MyApp.country.get('presidentName'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @TASKS TABLE ( TASK_ID INT IDENTITY PRIMARY KEY , TASK_NAME VARCHAR(256), TASK_COST FLOAT , PARTITION_ID INT DEFAULT 0) | |
DECLARE @MAX_PARTITION INT = 4 | |
WITH INIT_TASKS AS | |
(SELECT TOP @MAX_PARTITION | |
ROW_NUMBER(OVER() ORDER BY TASK_COST DESC) AS INIT_PARTITION | |
,PARTITION_ID | |
FROM @TASKS | |
ORDER BY TASK_COST DESC) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Add-Prop([string]$name,$value){ | |
$input |add-member -memberType Noteproperty -name $name -value $value -passThru | |
} | |
function Get-Partitions($no_partitions=4){ | |
$sums = @() | |
$indexes = (0..($no_partitions-1)) | |
$indexes |% { $sums+= 0 } | |
$sortedBySize = $input | Sort Length -Descending | |
foreach($file in $sortedBySize){ |