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
CarrierWave.configure do |config| | |
if Rails.env.development? || Rails.env.test? | |
config.storage = :file | |
else | |
config.storage = :fog | |
config.fog_credentials = { | |
provider: 'AWS', | |
aws_access_key_id: Rails.application.secrets.aws_access_key_id, | |
aws_secret_access_key: Rails.application.secrets.aws_secret_access_key |
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 "pstore" | |
require "json" | |
class JSON::Store < PStore | |
def dump(table) | |
# use JSON.pretty_generate(table) to make it even more human readable | |
JSON.generate(table) | |
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
# rails - translation/localization for time_ago_in_words - Romanian | |
ro-RO: | |
datetime: | |
distance_in_words: | |
less_than_x_minutes: | |
one: 'mai putin de un minut' | |
other: 'mai putin de {{count}} minute' | |
x_minutes: | |
one: 'un minut' | |
other: '{{count}} minute' |
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 because of http://stackoverflow.com/questions/4398966/how-can-i-hide-select-options-with-javascript-cross-browser/4423543 | |
(function($){ | |
$.fn.extend({detachOptions: function(o) { | |
var s = this; | |
return s.each(function(){ | |
var d = s.data('selectOptions') || []; | |
s.find(o).each(function() { | |
d.push($(this).detach()); |
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 'bundler/capistrano' | |
set :application, "videonight" | |
set :repository, "git://github.com/RainerBlessing/Videonight.git" | |
set :scm, :git | |
# Prevents error if not parameter passed, assumes that default 'cap deploy' command | |
# and should deploy the master branch to the production server | |
set(:env, 'production') unless exists?(:env) |
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 'mongoid' | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("so_test") | |
end | |
class Client | |
include Mongoid::Document | |
belongs_to :contact | |
field :name, type: String |
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
~ % source tmuxinator_completion | |
/home/kill/.rvm/gems/ruby-1.9.3-p125@global/bin/tmuxinator_completion:9: command not found: require | |
/home/kill/.rvm/gems/ruby-1.9.3-p125@global/bin/tmuxinator_completion:11: command not found: version | |
/home/kill/.rvm/gems/ruby-1.9.3-p125@global/bin/tmuxinator_completion:16: parse error near `end' | |
~ % which tmuxinator_completion | |
/home/kill/.rvm/gems/ruby-1.9.3-p125@global/bin/tmuxinator_completion | |
~ % cat =tmuxinator_completion | |
#!/home/kill/.rvm/rubies/ruby-1.9.3-p125/bin/ruby | |
# | |
# This file was generated by RubyGems. |
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
set :max_asset_age, 2 ## Set asset age in minutes to test modified date against. | |
after "deploy:finalize_update", "deploy:assets:determine_modified_assets", "deploy:assets:conditionally_precompile" | |
namespace :deploy do | |
namespace :assets do | |
desc "Figure out modified assets." | |
task :determine_modified_assets, :roles => assets_role, :except => { :no_release => true } do | |
set :updated_assets, capture("find #{latest_release}/app/assets -type d -name .git -prune -o -mmin -#{max_asset_age} -type f -print", :except => { :no_release => true }).split |
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 Image | |
include Mongoid::Document | |
field :likes_count, :type => Integer, :default => 0 | |
has_many :likes | |
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
location /assets/ { | |
gzip_static on; | |
expires max; | |
add_header Cache-Control public; | |
add_header Access-Control-Allow-Origin *; | |
} |
OlderNewer