Clone the uptime repository
$ git clone https://github.com/fzaninotto/uptime.git
Run this command to create the Procfile
:
$ echo "web: node app.js" > Procfile
Commit your changes
Clone the uptime repository
$ git clone https://github.com/fzaninotto/uptime.git
Run this command to create the Procfile
:
$ echo "web: node app.js" > Procfile
Commit your changes
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
#!/bin/bash | |
# from https://coderwall.com/p/gog45a | |
function lastworkingday() | |
{ | |
if [[ "1" == "$(date +%u)" ]] | |
then | |
echo "last friday" | |
else | |
echo "yesterday" |
# app/models/ability.rb | |
# All front end users are authorized using this class | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new | |
can :read, :all |
class EmailDigest < ActiveRecord::Base | |
has_many :digest_elements | |
has_many :articles, :through => :digest_elements, :source => :element, :source_type => 'Article' | |
has_many :questions, :through => :digest_elements, :source => :element, :source_type => 'Question' | |
end | |
class Article < ActiveRecord::Base | |
has_one :article_element, :as =>:element | |
has_one :email_digest, :through => :digest_elements | |
end |
class Alert < ActiveRecord::Base | |
belongs_to :alertable, :polymorphic => true | |
end | |
class Region < ActiveRecord::Base | |
has_many :alerts, :as => :alertable | |
end | |
# app/models/post.rb | |
class Post | |
searchable :auto_index => false, :auto_remove => false do | |
text :title | |
text :body | |
end | |
after_commit :sidekiq_solr_update, :if => :persisted? |
# ... | |
gem 'carrierwave' | |
gem 'fog' |
require 'spec_helper' | |
describe FeaturePool do | |
it "creates a new instance given valid attributes" do | |
Fabricate :feature_pool | |
end | |
it "is not valid without a name" do | |
Fabricate.build(:feature_pool, :name => "").should_not be_valid | |
end |
gemcutter => redis downloads spec | |
================================= | |
keys | |
---- | |
downloads => global counter for all gem downloads | |
downloads:today => sorted set for downloads from today | |
downloads:rubygem:rails => counter for all rails downloads | |
downloads:version:rails-2.3.5 => counter for all rails 2.3.5 downloads |