This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
if ENV["DISALLOW_ALL_WEB_CRAWLERS"].present? | |
http_basic_authenticate_with( | |
name: ENV.fetch("BASIC_AUTH_USERNAME"), | |
password: ENV.fetch("BASIC_AUTH_PASSWORD"), | |
) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
root /path/to/webapp/public; | |
index index.php index.html index.htm; | |
server_name webapp.local; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Start a new pool named 'www'. | |
; the variable $pool can we used in any directive and will be replaced by the | |
; pool name ('www' here) | |
[www] | |
; Per pool prefix | |
; It only applies on the following directives: | |
; - 'slowlog' | |
; - 'listen' (unixsocket) | |
; - 'chroot' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.box_check_update = false | |
config.vm.network "forwarded_port", guest: 22, host: 2222, id: 'ssh' | |
config.vm.network "private_network", ip: "10.10.0.2" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = "1024" | |
end | |
config.vm.provision "shell", path: "script.sh" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name ums.harukaeduapps.com; | |
# Tell Nginx and Passenger where your app's 'public' directory is | |
root /home/deploy/htdocs/ums/current/public; | |
# Turn on Passenger | |
passenger_enabled on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Story: Account Holder withdraws cash | |
As an Account Holder | |
I want to withdraw cash from an ATM | |
So that I can get money when the bank is closed | |
Scenario 1: Account has sufficient funds | |
Given the account balance is \$100 | |
And the card is valid | |
And the machine contains enough money |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Warning: Setting DYLD_* vars can break dynamic linking. | |
Set variables: | |
DYLD_FALLBACK_LIBRARY_PATH | |
Warning: "config" scripts exist outside your system or Homebrew directories. | |
`./configure` scripts often look for *-config scripts to determine if | |
software packages are installed, and what additional flags to use when | |
compiling and linking. | |
Having additional scripts in your path can confuse software installed via |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set :stage, :staging | |
server "example.com", roles: [:app, :web, :db] | |
set :ssh_options, { | |
user: "william", | |
forward_agent: true | |
} | |
set :deploy_to, "/home/william/htdocs/#{fetch(:application)}" | |
set :deploy_via, :remote_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The Slim Framework helps you map resource URIs to callback functions | |
// for specific HTTP request methods (e.g. GET, POST, PUT, DELETE, OPTIONS or HEAD). | |
// A Slim application will invoke the first route that matches | |
// the current HTTP request’s URI and method. | |
// If the Slim application does not find routes with URIs that match | |
// the HTTP request URI and method, it will automatically | |
// return a 404 Not Found response. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})" | |
local user_host='%{$terminfo[bold]$fg[green]%}%n@%m%{$reset_color%}' | |
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}' | |
local ruby_version='%{$fg[red]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' | |
local git_branch='$(git_prompt_info)%{$reset_color%}' | |
local php_version='%{$fg[blue]%}‹$(phpbrew_current_php_version | sed -e "s/[-a-z][^0-9]*//g")›%{$reset_color%}' | |
PROMPT="╭─${user_host} ${current_dir} ${ruby_version} ${php_version} ${git_branch} | |
╰─%B$%b " |