Skip to content

Instantly share code, notes, and snippets.

@vivekkhokhar
vivekkhokhar / git-branches-by-commit-date.sh
Created May 12, 2016 17:30 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@vivekkhokhar
vivekkhokhar / aws-s3-all-perms
Created July 15, 2015 00:52
AWS S3 IAM policy for single bucket with all permissions
{
"Statement": [
{
"Action": "s3:*",
"Effect": "Allow",
"Resource": "arn:aws:s3:::rowan-dev"
},
{
"Action": "s3:*",
"Effect": "Allow",
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
require 'bundler/capistrano'
set :whenever_command, "bundle exec whenever"
set :whenever_variables, defer { "'environment=production&application=#{application}'" }
set :whenever_roles, 'whenever'
require "whenever/capistrano"
set :repository, "[email protected]:somerepo.git"
set :branch, do
Capistrano::CLI.ui.ask("\nType the branch name. Default would be:") {|q| q.default = 'master' }