Skip to content

Instantly share code, notes, and snippets.

@geoffroymontel
geoffroymontel / ruby2-rails4.md
Last active December 20, 2015 03:09
Problem running Ruby 2 + Rails 4 on Ubuntu 12.04 TLS

Hello

I'm trying to use Ruby 2 and Rails 4 on production but there seems to be a problem with the version of Rubygems that comes with Ruby 2.0.0-p247.

I installed Ruby 2.0.0-p247 and Rails 4.0.0 on a fresh Ubuntu 12.04 TLS server VM

vagrant@dev:~$ gem -v
2.0.3
vagrant@dev:~$ bundle -v
@geoffroymontel
geoffroymontel / crop-center-css.md
Last active December 15, 2017 01:12
Crop and center image with CSS only

Easily resize, crop and center an image on any container with CSS

<div id="graphic">lorem ipsum</div>
#graphic {
  width: 300px;
 height: 200px;
@geoffroymontel
geoffroymontel / batch-convert-mp4-wmv.md
Created May 4, 2014 21:59
Conversion batch mp4 -> WMV

for i in *.mp4; do ffmpeg -i $i -q 0 wmv/$i.wmv; done

@geoffroymontel
geoffroymontel / gist:46f1cef9ea84dead1d4e
Created May 17, 2014 09:53
Batch resize images to maximum width or height of 1024px
for i in books.original/*; do convert $i -resize 1024x1024\> books/$(basename $i); done
@geoffroymontel
geoffroymontel / gist:e61f2fe74dde65eeb04e
Created December 28, 2015 21:45
Extract subtitles from video
ffmpeg -i Movie.mkv -map 0:s:0 subs.srt
@geoffroymontel
geoffroymontel / gist:ae0daf73604379f8dec1
Created December 30, 2015 12:40
WIFI scan on MacOsX
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
@geoffroymontel
geoffroymontel / .bash_profile
Created April 25, 2016 16:04
Affichage du directory courant et de la branche git
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\u@\h \[\033[32m\]\w\[\033[33m\]\$(parse_git_branch)\[\033[00m\] $ "
@geoffroymontel
geoffroymontel / gist:7db00e9e23c695e6a12b68c8942161e5
Last active December 26, 2019 20:46
extract srt from video
there is several subtitle format, SRT, STL(mainly use by Apple), etc.... and ffmpeg support a lot of them http://ffmpeg.org/general.html#Subtitle-Formats
and ffmpeg can extract them with cmd line the following sequence of command:
1) perform track identification
ffmpeg -i yourFile
drutil burn -noverify -eject foo.cue
@geoffroymontel
geoffroymontel / gist:4a9494c8c3e2edb5ed320f2500fab953
Created August 22, 2016 09:04
Convert audio to FLAC 16khz mono
ffmpeg -i test_track.mp3 -ar 16000 -ac 1 -acodec flac test_track.flac