🎯
- GitHub Staff
- https://fjcasas.es
- @[email protected]
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
<!-- app/views/foos/_foo.html.erb --> | |
<tr> | |
<td> | |
<%= foo.name %> | |
</td> | |
<td> | |
<%= foo.color %> | |
</td> | |
</tr> |
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
class User < ActiveRecord::Base | |
has_attached_file :avatar, | |
:styles => { :thumbnail => "80x80>", :normalized => "100%" }, | |
:convert_options => { :all => '-strip -colorspace RGB'}, | |
:default_style => :normalized | |
end |
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 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 |
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
<!-- 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({ |
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
class Article | |
has_many :categories, :through => :category_articles | |
has_many :category_articles | |
end |
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
require File.expand_path(File.join(Gem.datadir('paperclip'), '..', '..', 'shoulda_macros', 'paperclip.rb')) | |
class ActiveSupport::TestCase | |
# ... | |
# here comes your custom test options | |
end |
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
#Newest versions | |
import File.expand_path(File.join(Gem.datadir('paperclip'), '..', '..', 'lib', 'tasks', 'paperclip.rake')) | |
# Versions older than 2.3.2 | |
import File.expand_path(File.join(Gem.datadir('paperclip'), '..', '..', 'tasks', 'paperclip_tasks.rake')) |
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
# config/initializer/active_merchant.rb | |
if Rails.env.production? | |
PAYPAL_ACCOUNT = '[email protected]' | |
else | |
PAYPAL_ACCOUNT = '[email protected]' | |
ActiveMerchant::Billing::Base.mode = :test | |
end | |
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
[-4, 5] in /projects/889122/small_script.rb | |
=> 1 dude = true | |
2 | |
3 if dude | |
4 puts "Hey dude" | |
5 else | |
/projects/889122/small_script.rb:1 | |
dude = true | |
(rdb: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
# Gemfile | |
# For ruby 1.8 | |
gem "rack-debug", "~> 1.4", :group => :development | |
# For ruby 1.9.2 | |
gem "rack-debug", :group => :development |
OlderNewer