Skip to content

Instantly share code, notes, and snippets.

View franciscoj's full-sized avatar
🎯
Focusing

Fran Casas franciscoj

🎯
Focusing
View GitHub Profile
@franciscoj
franciscoj / flowplayer_on_fancybox.html
Created September 9, 2010 09:22
How to include a flowplayer video inside a fancybox modal window
<!-- Don't forget to include flowplayer js and fancybox js and css -->
<div style="width:665px;height:480px;display:none;" id="player">
</div>
<a id="play-flv-video" href="#player">Play video</a>
<script language="JavaScript">
$(document).ready(function() {
$("a#play-flv-video").fancybox({
@franciscoj
franciscoj / mov_to_flv.sh
Created September 9, 2010 07:41
how to convert a mov video to flv using flvtool2 gem to set the metadata
# this is how to convert a mov video to flv using flvtool2 gem to set the metadata
ffmpeg -i film.mov -ar 44100 -ab 192k -b 400k -s 320x240 -aspect 4:3 -f flv - | flvtool2 -U stdin film.flv
@franciscoj
franciscoj / cmyk_to_rgb.rb
Created September 6, 2010 10:42
A way to handle CMYK in your RoR application with paperclip
class User < ActiveRecord::Base
has_attached_file :avatar,
:styles => { :thumbnail => "80x80>", :normalized => "100%" },
:convert_options => { :all => '-strip -colorspace RGB'},
:default_style => :normalized
end
@franciscoj
franciscoj / _foo.html.erb
Created July 17, 2010 13:45
how to handle render :collection => @foos in rails when @foos is an empty collection
<!-- app/views/foos/_foo.html.erb -->
<tr>
<td>
<%= foo.name %>
</td>
<td>
<%= foo.color %>
</td>
</tr>