Skip to content

Instantly share code, notes, and snippets.

View russoedu's full-sized avatar

Eduardo Russo russoedu

  • JATO Dynamics
  • London, UK
View GitHub Profile
@jpluimers
jpluimers / recursively-convert-wma-to-mp3-using-ffmeg.sh
Created April 14, 2016 21:28
Recursively convert WMA files to MP3 using ffmeg on a Mac OS X bash shell
find . -iname "*.wma" -execdir bash -c 'NAME="{}" && ffmpeg -y -i "$NAME" -ab 192k "${NAME/.wma/.mp3}" -map_metadata 0:s:0 && rm "$NAME"' \;
@taylorkearns
taylorkearns / roundUp49
Created April 20, 2012 14:58
Rounds decimals ending in .49 up to .5. (Native JS Math.round() method rounds XX.49 down to XX.) If you want to use the Math.round() method but want to round up X.49, use this method in place of Math.round().
var _round = function(num) {
if(isDecimal(num)) {
var num_array = num.toString().split(".");
var whole_num = parseInt(num_array[0]);
var decimal_num = parseFloat("." + num_array[1]);
if(decimal_num > .444444444444444 && decimal_num < .5) {
decimal_num = .5;
}
num = whole_num + decimal_num;
}
@douglas
douglas / update_git_repos.sh
Created October 14, 2011 15:04
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do