Skip to content

Instantly share code, notes, and snippets.

View walterdavis's full-sized avatar

Walter Lee Davis walterdavis

View GitHub Profile
private function decode_fluency($record){
$values = array('' => 0, 'none' => 0, 'basic' => 1, 'functional' => 2, 'fluent' = 3);
$read = $values[$record['can_read']];
$write = $values[$record['can_write']];
$speak = $values[$record['can_speak']];
$this->can_read = ($read > 0);
$this->can_write = ($write > 0);
$this->can_speak = ($speak > 0);
$this->can_understand_spoken = ($speak > 2); //speak is fluent
$this->can_peer_review = ($read == 3 && $write >= 2); //read is fluent & write is fluent/functional
<?php
$rows = 106;
function seek_row_count($rows, $target = 35){
$result = $rows % $target;
if($result == 0 || $result > 1) return $target;
return seek_row_count($rows, --$target);
}
print seek_row_count($rows, 35);
?>
document.on('click', 'input[name="commit"]', function(evt, elm){
var f = elm.up('form');
fake_progress = new Element('div', {className: 'progress progress-striped active', style: 'width: 100%; clear:both'});
f.insert({before: fake_progress});
var bar = new Element('div', {className: 'bar'});
fake_progress.insert(bar);
bar.setStyle('width: 2%');
var rnd = 0.2
function add_random(){
rnd = Math.random();
// get a reference to all of the thumbnails
var thumbnails = $$('#thumbnails img');
// listen for a click on one of them
document.on('click', '#thumbnails img', function(evt, elm){
// remove the highlight from the current element
thumbnails.invoke('removeClassName', 'active');
// insert a copy of the selected image in the main area
$('main').update(elm.clone(true));
// highlight the new current thumbnail
elm.addClassName('active');
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>jQuery Without Duplication</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
[paperclip] copying assets/blobs/000/011/848/original/Sting_CB_Bounce_Blue.mov to local file /tmp/Sting_CB_Bounce_Blue20140730-24289-1vunrv7.mov
Sting_CB_Bounce_Blue.mov
[paperclip] [ffmpeg] ffmpeg -i "/tmp/Sting_CB_Bounce_Blue20140730-24289-1vunrv7.mov" 2>&1
[paperclip] [ffmpeg] Command Success
ubuntu@ip-10-93-169-71:~/www$ ffmpeg -i ProRes422HQ_Test.mov -c:v libx264 -b:v 3500k -me_method umh -pix_fmt yuv420p -s 1280x720 -profile:v baseline -c:a libfaac -b:a 128k -ar 48000 ProRes422HQ_Test.mp4
ffmpeg version N-64743-g162cffc Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 17 2014 22:56:46 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configuration: --prefix=/usr/local --enable-gpl --enable-version3 --enable-nonfree --enable-shared --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid
libavutil 52. 92.101 / 52. 92.101
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.101 / 55. 48.101
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.102 / 4. 11.102
libswscale 2. 6.100 / 2. 6.100