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
private function recursiveCheck($array) | |
{ | |
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($array), | |
RecursiveIteratorIterator::SELF_FIRST); | |
foreach ($iterator as $key => $current) { | |
$keyValid = array('section', 'block', 'text', 'item'); | |
if(in_array($key, $keyValid) && $key !== 0 && $this->is_assoc($current)){ | |
//error_log('key: '.$key); | |
$prevValue = $iterator->getInnerIterator()->offsetGet( $key ); | |
$iterator->getInnerIterator()->offsetUnset($key); |
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 getCanvasURL(canvas){ | |
var parts = canvas.toDataURL().match(/data:([^;]*)(;base64)?,([0-9A-Za-z+/]+)/); | |
//assume base64 encoding | |
var binStr = atob(parts[3]); | |
//convert to binary in ArrayBuffer | |
var buf = new ArrayBuffer(binStr.length); | |
var view = new Uint8Array(buf); | |
for (var i = 0; i < view.length; 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
Router.map(function() { | |
this.route('messages', { | |
path: '/api/messages', | |
where: 'server', | |
action: function() { | |
xml2js = Meteor.npmRequire('xml2js'); | |
// GET, POST, PUT, DELETE | |
var req = this.request; | |
var res = this.response; |
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 fs = require('fs'), | |
videoName = './record_10.mp4', | |
child_process = require("child_process"), | |
exec = child_process.exec; | |
/*This works like a charm*/ | |
var ffmpeg = child_process.spawn("ffmpeg", [ | |
'-i', videoName, // path | |
'-vf', 'thumbnail,scale=640:360', | |
'-r', '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 fs = require('fs'), | |
schedule = require('node-schedule'), | |
currentfilename = '/Users/gabrielstuff/Desktop/default/iehg', | |
newFilename = '/Users/gabrielstuff/Desktop/default/video', | |
extension = 'mp4', | |
number = 0; | |
function rename() { | |
fs.rename(currentfilename+'.' + extension, newFilename + '_' + number + '.' + extension, function(err) { | |
if (err) { |
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
db['cfs.medias.filerecord'].aggregate( | |
[ | |
{ | |
$project: | |
{ | |
year: { $year: "$uploadedAt" }, | |
month: { $month: "$uploadedAt" }, | |
day: { $dayOfMonth: "$uploadedAt" }, | |
hour: { $hour: "$uploadedAt" }, | |
minutes: { $minute: "$uploadedAt" }, |
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 generatePreview(fileObj, readStream, writeStream) { | |
fileObj.name('preview.jpg', { | |
store: 'thumbs' | |
}); | |
fileObj.extension('jpg', { | |
store: 'thumbs' | |
}); | |
fileObj.type('image/jpg', { | |
store: 'thumbs' | |
}); |
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
# Installation | |
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid --with-libvidstab --with-libvpx | |
# Easy Peasy | |
ffmpeg -i video.mp4 video.webm |
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
add_filter('login_errors',create_function('$a', "return null;")); |
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
diff --exclude=".svn" -rq ~/mounts/www.example.com/ /var/www/www.example.com/ |
OlderNewer