Send email asynchroniously using Sidekiq.
Create your mailer us usual:
// http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit | |
// form_submit('/contact/', {name: 'Johnny Bravo'}); | |
function form_submit(path, params, method) { | |
method = method || "post"; // Set method to post by default if not specified. | |
// The rest of this code assumes you are not using a library. | |
// It can be made less wordy if you use one. | |
var form = document.createElement("form"); | |
form.setAttribute("method", method); | |
form.setAttribute("action", path); |
var t3 = THREE; | |
var light = new t3.PointLight(); | |
light.position.set(20, 10, 10); | |
scene.add(light); | |
var makeCube = function(x, y, z) { | |
var cube = new t3.Mesh( | |
# Example Dockerfile | |
FROM hello-world |
# shortform git commands | |
alias g='git' | |
# push changes to an empty git repository for the first time | |
git push --set-upstream origin master | |
# remove untracked files in a git repository | |
git status -su | cut -d' ' -f2- | tr '\n' '\0' | xargs -0 rm | |
# get most modified files and counts |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
# RSpec matcher for validates_with. | |
# https://gist.github.com/2032846 | |
# Usage: | |
# | |
# describe User do | |
# it { should validate_with CustomValidator } | |
# end | |
# | |
# describe User do | |
# it do |
de: | |
faker: | |
locales: | |
locale: [de, en, fr] | |
salutations: | |
de: [Herr, Frau] | |
en: [Mr, Mrs] | |
fr: [M., Mme] | |
address: | |
country_code: [CH, CH, CH, DE, AT, US, LI, US, HK, VN] |
gem 'rails_12factor'
to your Gemfile. This will add error logging and the ability for your app to serve static assets.bundle
RAILS_ENV=production rake db:create db:migrate db:seed
rake secret
and copy the outputexport SECRET_KEY_BASE=output-of-rake-secret
rake assets:precompile
. This will create a folder public/assets
that contains all of your assets.RAILS_ENV=production rails s
and you should see your app.Remember to clobber your assets (rake assets:clobber
) and re-precompile (rake assets:precompile
) if you make changes.
# | |
# enqueue with following parameters hash: | |
# - headers | |
# - work_at - time of execution | |
# - work_queue - destination queue for actually doing the work | |
# | |
class DelayWorker | |
include Sneakers::Worker | |
from_queue :treadmill, { handler: Sneakers::Handlers::Delay } |