As configured in my dotfiles.
start new:
tmux
start new with session name:
| [%~ | |
| # Some illustrious documentation to get you started: | |
| # | |
| # The macros defined are to generate markup to save people from copy and pasting | |
| # markup. They copy and paste hashes instead, which should be safer (in theory) | |
| # | |
| # The macros for forms are: | |
| # * text_field - A simple text field, pass in type to override input type | |
| # * password_field - A password field, equivalent to | |
| # text_field({ type => 'password', ... }) |
| # inspired by https://github.com/rspec/rspec-core/pull/596 | |
| require 'rspec/core/formatters/base_formatter' | |
| module RSpec | |
| module Core | |
| module Formatters | |
| class FailuresFormatter < BaseFormatter | |
| def dump_failures | |
| return if failed_examples.empty? |
| #!/bin/sh | |
| git filter-branch --env-filter ' | |
| an="$GIT_AUTHOR_NAME" | |
| am="$GIT_AUTHOR_EMAIL" | |
| cn="$GIT_COMMITTER_NAME" | |
| cm="$GIT_COMMITTER_EMAIL" | |
| if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ] |
| set :shared_children, shared_children << 'tmp/sockets' | |
| namespace :deploy do | |
| desc "Start the application" | |
| task :start, :roles => :app, :except => { :no_release => true } do | |
| run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false | |
| end | |
| desc "Stop the application" | |
| task :stop, :roles => :app, :except => { :no_release => true } do |
| var parser = document.createElement('a'); | |
| parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
| parser.protocol; // => "http:" | |
| parser.hostname; // => "example.com" | |
| parser.port; // => "3000" | |
| parser.pathname; // => "/pathname/" | |
| parser.search; // => "?search=test" | |
| parser.hash; // => "#hash" | |
| parser.host; // => "example.com:3000" |
| function merge(target, source) { | |
| /* Merges two (or more) objects, | |
| giving the last one precedence */ | |
| if ( typeof target !== 'object' ) { | |
| target = {}; | |
| } | |
| for (var property in source) { |
| /* Exercise: Loops and Functions #43 */ | |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| func Sqrt(x float64) float64 { | |
| z := float64(2.) |
| #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) |
| #!/bin/bash | |
| PORT=5000 | |
| # This should be the directory name/app name | |
| APP="TDP" | |
| PIDFILE="$HOME/$APP.pid" | |
| STATUS="$HOME/$APP.status" | |
| # The actual path on disk to the application. | |
| APP_HOME="$HOME/$APP" |
As configured in my dotfiles.
start new:
tmux
start new with session name: