This was working on Vagrant 1.4.3 (Mac).
#HOST#
File: ~/.ssh/config
Host vagrant.*
ForwardAgent yes
File: Vagrantfile
| #!/usr/bin/ruby | |
| # | |
| # release notes script | |
| # takes two git tags and prints any changes between them | |
| # | |
| # usage: | |
| # ./releasenotes.sh [from] [to] [releasename] | |
| # | |
| # with [from] and [to] being git tags |
This was working on Vagrant 1.4.3 (Mac).
#HOST#
File: ~/.ssh/config
Host vagrant.*
ForwardAgent yes
File: Vagrantfile
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Occassionally we want to make a rule that matches on something more complex than file extensions. If, for example files that will be prefixed with pandoc_ depend on files that do not contain the prefix.
Ex: pandoc_slides=>slides.rmd. we can make a rule that will capture this, but we need to use a lambda function to do so:
rule (%r{pandoc_.*\.md}) => lambda{|objfile| potential_source_files.find{objfile.pathmap("%{pandoc_,}n")}} do |t|
puts "This rule gets #{t.name} from #{t.source}"
end
| #!/usr/bin/env bash | |
| size=1024 # MB | |
| mount_point=$HOME/tmp | |
| name=$(basename "$mount_point") | |
| usage() { | |
| echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \ | |
| "(default: mount)" >&2 | |
| } |
| Capistrano::Configuration.instance(true).load do | |
| namespace :db do | |
| desc "Create database user for current site" | |
| task :create_user, roles: :db do | |
| config = Pathname.new(__dir__).join("..", "database.yml") | |
| config = ERB.new(config.read).result(binding) | |
| config = YAML.load(config) | |
| fail "No database config for #{stage}" unless config[stage.to_s] | |
| username, password = config[stage.to_s].values_at("username", "password") | |
| run "#{sudo as: 'postgres'} psql -d postgres" do |channel, _, _| |
| #!/bin/bash | |
| # Thanks goes to @pete-otaqui for the initial gist: | |
| # https://gist.github.com/pete-otaqui/4188238 | |
| # | |
| # Original version modified by Marek Suscak | |
| # | |
| # works with a file called VERSION in the current directory, | |
| # the contents of which should be a semantic version number | |
| # such as "1.2.3" or even "1.2.3-beta+001.ab" |