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
//FFMPEG PART | |
ffmpeg -i "path/to/the/video.ext" -an -f image2 -q:v 8 "path/to/destination/folder/%d.ext" | |
-> -q:v n ( quality : n = int 1 -> 32 where 1 is best than 32 ) | |
//FRAME PLAYER PART ( http://vagnervjs.github.io/frame-player/ ) | |
cd converter | |
node app.js x y folder/to/imgs/ json/video.json | |
-> x : startImgNumber, y : endImgNumber |
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 iOSversion() { | |
if (/iP(hone|od|ad)/.test(navigator.platform)) { | |
// supports iOS 2.0 and later: <http://bit.ly/TJjs1V> | |
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/); | |
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)]; | |
} | |
} | |
var version = iOSversion(); |
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
In /etc/apache2/users/username.conf | |
<Directory "/www"> | |
Options FollowSymLinks Indexes MultiViews | |
AllowOverride All | |
Order allow,deny | |
Allow from all | |
</Directory> |
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
//This script creat a lot of 'fake' users for your WordPress | |
//Usefull for developper | |
//This is a modified version of that script : http://wpengineer.com/2054/create-users-automatically-in-wordpress/ | |
//Add this to the functions.php file of your theme then visite the dashboard. | |
function fb_wp_insert_user(){ | |
for ($i = 1; $i <= 100; $i++) { | |
$user_data = array( | |
'ID' => '', | |
'user_pass' => wp_generate_password(), |
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
//From http://cwestblog.com/2012/11/12/javascript-degree-and-radian-conversion/ | |
// Converts from degrees to radians. | |
Math.radians = function(degrees) { | |
return degrees * Math.PI / 180; | |
}; | |
// Converts from radians to degrees. | |
Math.degrees = function(radians) { | |
return radians * 180 / Math.PI; |
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 checkNumber(testedString) { | |
var newStr = testedString.replace(/(^\s+|\s+$)/g,''); | |
if (newStr.length > 0) { | |
if (/[^0-9]/.test(newStr)) return false; | |
else return true; | |
} else return false; | |
} |
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 checkAlpha(word) { | |
var newStr = word.replace(/(^\s+|\s+$)/g,''); | |
if (newStr.length > 0) { | |
if (/[^A-Za-zàáâãäåæçèéêëæìíîïñòóôõöøßùúûüÿÀÁÂÃÄÅÆÇÈÉÊËÆÌÍÎÏÑÒÓÔÕÖØßÙÚÛÜŸ \-']/.test(newStr)) return false; | |
else return true; | |
} else return false; | |
} |
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
export PATH=/mongo/bin:$PATH | |
export PATH=/phantomjs/bin:$PATH | |
function tabname { | |
printf "\e]1;$1\a" | |
} | |
function winname { | |
printf "\e]2;$1\a" | |
} |
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 img = new Image(); | |
img.src = canvas.toDataURL(); | |
document.body.appendChild(img); |
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 r = Math.random(); | |
var randomPoint = { | |
'x': (1-r)*this.v1.x + r*this.v2.x, | |
'y' : (1-r)*this.v1.y + r*this.v2.y | |
} | |
//Where v1 & v2 are the two points defining the line. |
OlderNewer