Because loading gems can take longer than you think
Now available as a gem - get it here
Because loading gems can take longer than you think
Now available as a gem - get it here
.progress { | |
border: 1px solid #ddd; | |
width: 100px; | |
height: 10px; | |
} | |
.progress .bar { | |
background-color: #aae; | |
width: 10px; | |
height: 10px; | |
} |
%w[ | |
CollectionSelectInput | |
DateTimeInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
#config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
if Rails.env.production? or Rails.env.development? | |
config.storage :cloud_files | |
config.cloud_files_username = "your_username" | |
config.cloud_files_api_key = "your_key" | |
config.cloud_files_container = "test" | |
config.cloud_files_cdn_host = "c0012345.cdnn.cloudfiles.rackspacecloud.com" | |
def store_dir |
class Forum | |
include Mongoid::Document | |
include Mongoid::Timestamps | |
field :posts_count, :type => Integer, :default => 0 | |
has_many_related :posts | |
end |
References: | |
http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/ | |
https://github.com/cyu/rack-cors | |
http://nelm.io/blog/2011/11/cors-with-sencha-touch/ | |
http://jessehowarth.com/2011/04/27/ajax-login-with-devise | |
============================================================================================================= | |
GEMFILE | |
============================================================================================================= | |
gem 'rack-cors', :require => 'rack/cors' |
$ chmod +x ./proxy_list_fetcher.rb | |
$ ./proxy_list_fetcher.rb | head | |
180.94.88.58 8080 Afghanistan fast HTTPS High +KA | |
187.87.155.2 8080 Brazil fast HTTPS High +KA | |
120.132.132.119 8080 China medium HTTPS High +KA | |
210.211.109.244 8081 Viet Nam fast HTTP Low | |
216.244.71.143 3128 United States medium HTTPS High +KA | |
190.237.224.22 8080 Peru slow HTTPS High +KA |
# Русский перевод для https://github.com/plataformatec/devise/tree/v1.4.2 | |
# Другие переводы на https://github.com/plataformatec/devise/wiki/I18n | |
ru: | |
errors: | |
messages: | |
expired: "устарела. Пожалуйста, запросите новую" | |
not_found: "не найдена" | |
already_confirmed: "уже подтверждена. Пожалуйста, попробуйте войти в систему" | |
not_locked: "не заблокирована" |
# Set up ssh-agent | |
SSH_ENV="$HOME/.ssh/environment" | |
function start_agent { | |
echo "Initializing new SSH agent..." | |
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}" | |
echo succeeded | |
chmod 600 "${SSH_ENV}" | |
. "${SSH_ENV}" > /dev/null | |
/usr/bin/ssh-add; |
// Desired unique index: | |
// db.collection.ensureIndex({ firstField: 1, secondField: 1 }, { unique: true}) | |
db.collection.aggregate([ | |
{ $group: { | |
_id: { firstField: "$firstField", secondField: "$secondField" }, | |
uniqueIds: { $addToSet: "$_id" }, | |
count: { $sum: 1 } | |
}}, | |
{ $match: { |