gem install rails
rails new my_app -T
;; emacs configuration | |
(push "/usr/local/bin" exec-path) | |
(add-to-list 'load-path "~/.emacs.d") | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
(setq-default tab-width 2) | |
(setq-default indent-tabs-mode nil) | |
(setq inhibit-startup-message t) |
fa: | |
errors: | |
messages: | |
not_found: "یافت نشد" | |
already_confirmed: "قبلا تایید شده است" | |
not_locked: "قفل نشده است" | |
not_saved: | |
one: "۱ خطا جلوی ذخیره %{resource} را گرفت:" | |
other: "%{count} خطا جلوی ذخیره این %{resource} را گرفت:" |
#!/usr/bin/env bash | |
# Formatting constants | |
export BOLD=`tput bold` | |
export UNDERLINE_ON=`tput smul` | |
export UNDERLINE_OFF=`tput rmul` | |
export TEXT_BLACK=`tput setaf 0` | |
export TEXT_RED=`tput setaf 1` | |
export TEXT_GREEN=`tput setaf 2` | |
export TEXT_YELLOW=`tput setaf 3` |
# WAIT! Do consider that `wait` may not be needed. This article describes | |
# that reasoning. Please read it and make informed decisions. | |
# https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
describe 'Modal' do | |
should 'display login errors' do | |
visit root_path |
require 'rubygems' if RUBY_VERSION < '1.9' | |
require 'tempfile' | |
require File.join(ENV['JETPAC_PATH'], 'library/logger') | |
require File.join(ENV['JETPAC_PATH'], 'library/email') | |
def image_command(command) | |
log "IMG: Running '#{command}'" | |
result = system(command) | |
if !result |
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
Kitfox::Application.routes.draw do | |
offline = Rails::Offline.configure :cache_interval => 30 do | |
cache_buster_timestamp = "20120429" | |
files = Dir[ | |
"#{root}/**/*.html", | |
"#{root}/stylesheets/**/*.css", | |
"#{root}/javascripts/**/*.js", | |
"#{root}/images/**/*.*"] | |
files.each do |file| |
upstream myapp { | |
server unix:///myapp/tmp/puma.sock; | |
} | |
server { | |
listen 80; | |
server_name myapp.com; | |
# ~2 seconds is often enough for most folks to parse HTML/CSS and | |
# retrieve needed images/icons/frames, connections are cheap in |
var system = require('system'); | |
if (system.args.length < 5) { | |
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code."); | |
phantom.exit(); | |
} | |
var account = system.args[1]; | |
var username = system.args[2]; | |
var password = system.args[3]; |