Skip to content

Instantly share code, notes, and snippets.

@bsnape
bsnape / delete-remote-merged-branches
Last active December 18, 2015 23:59 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
awk '{split($0,a,"/"); print a[2]}' |
xargs git push origin --delete
#!/bin/bash
while :
do
clear
git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all
sleep 1
done
@bsnape
bsnape / gist:7750443
Created December 2, 2013 14:41
delete merged local branches
git branch --merged master | grep -v 'master$' | xargs git branch -d
@bsnape
bsnape / gist:2574bcb399a5faf0f38f
Created May 20, 2014 11:34
Bash single-line for loop
for i in {1..50}; do curl localhost:9086/status; echo; sleep 1; done
@bsnape
bsnape / gist:8cdbc0067e713a5129c1
Created April 2, 2015 12:57
Unpack RPM on OSX
brew install rpm
brew install rpm2cpio
rpm2cpio <rpm> | cpio -i -d
@bsnape
bsnape / gist:edff869d5b7dc0b0d7c2
Last active August 29, 2023 05:15
Rubymine find & replace string hash rockets with new syntax
find:
\'(\w+)\'\s*=>
replace:
$1:
replace symbol hash rockets with new syntax
find:
# in every instance boot inject the public key to every instance
aws --profile deirdre-dev ec2 create-key-pair --key-name deirdre-ec2-provision

Keybase proof

I hereby claim:

  • I am bsnape on github.
  • I am bsnape (https://keybase.io/bsnape) on keybase.
  • I have a public key ASDW2X76h7KjXs91WikHSAEt9YGobKZlgfv0nabowf77Xwo

To claim this, I am signing this object:

@bsnape
bsnape / seq.ps1
Last active August 9, 2017 19:42
configuration SeqInstall {
Import-DscResource –ModuleName 'PSDesiredStateConfiguration'
node "localhost" {
File CreateFile {
DestinationPath = 'C:\Windows\Temp\foo3.txt'
Ensure = "Present"
Contents = 'Hello World!'
}
}
}
function Invoke-SeqLogConfiguration {
$tempRoot = "D:"
$tempDirectory = "$tempRoot\temp"
if ([System.IO.Directory]::Exists($tempDirectory) -eq $true) {
rm $tempDirectory -Recurse -Force -Verbose -ErrorAction Ignore
}
mkdir $tempDirectory -ErrorAction Ignore