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
$(function(){ | |
$('a').click(function(){ | |
var source = ''; | |
var destination = ''; | |
var link_text = ''; | |
source = window.location.pathname; | |
if($(this).attr('href')){ |
if (Math.floor(Math.random()*2) == 1) { | |
alert('foo') | |
} else { | |
alert('bar') | |
} |
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' |