Skip to content

Instantly share code, notes, and snippets.

View marc0der's full-sized avatar

Marco Vermeulen marc0der

View GitHub Profile
@marc0der
marc0der / gist:4131836
Created November 22, 2012 15:55
Switches gvm to use the correct version of grails for the current project.
alias switch='cat application.properties | grep app.grails.version | sed "s_app.grails.version=__g" | xargs gvm use grails'
@marc0der
marc0der / gist:4095013
Created November 17, 2012 11:13
Add environments to Gradle build
def loadConfiguration() {
def environment = hasProperty('env') ? env : 'dev'
ext.environment = environment
println "Environment is set to: $environment"
def configFile = file('config.groovy')
def config = new ConfigSlurper(environment).parse(configFile.toURL())
ext.config = config
}
@marc0der
marc0der / gist:4077772
Created November 15, 2012 09:59
Iterate over files with spaces in names with bash
find -d /some/directory -type f -depth 1 | grep $ | while read file; do
#perform some work on $file here
done
@marc0der
marc0der / gist:3994996
Created November 1, 2012 16:51
Open new files from the command line in new MacVim tabs.
#make sure you have the mvim script on your path already ;-)
alias mvim="mvim --servername VIM --remote-tab $1 &> /dev/null"
@marc0der
marc0der / gist:3910791
Created October 18, 2012 09:51
Add this to your .gitconfig for a colourful log that shows diverging/merging branches.
[alias]
vlog = log --graph --date-order --date=relative --pretty=format:'%C(cyan)%h: %Cblue - %an - %Cgreen %C(cyan)%ar:%Creset%n%s%n' --color
@marc0der
marc0der / gist:3758449
Created September 20, 2012 21:26
Griffon 1.1.0 error
bin/griffon: 140: [: 0: unexpected operator
bin/griffon: 247: exec: /usr/lib/jvm/java-6-openjdk-amd64: Permission denied
@marc0der
marc0der / prepare-debian-package.sh
Created May 23, 2012 20:28
Prepare Packages for Launchpad
#!/bin/bash
ARCHIVE_FOLDER="$1"
PACKAGE="$2"
VERSION="$3"
RELEASE="$4"
PRIORITY="$5"
if [ -z "$ARCHIVE_FOLDER" -o -z "$PACKAGE" -o -z "$VERSION" -o -z "$RELEASE" -o -z "$PRIORITY" ]; then
echo "Usage: prepare-debian-package <archive folder> <package> <version> <release> <priority>"
@marc0der
marc0der / gist:2369077
Created April 12, 2012 16:52
Deploy jar to Private Webdav Maven repo
mvn deploy:deploy-file
-DgroupId=zzzzz
-DartifactId=yyyyy
-Dversion=2.2.0
-Dpackaging=jar
-Dfile=target/grails-plugin-xxx-2.2.0.jar
-DrepositoryId=my-private-release-repository
-Durl=dav:https://myrepo/release/
@marc0der
marc0der / gist:1650125
Created January 20, 2012 23:08
colourful bash prompt with git branch
#using git-completion script
source ~/bin/git-completion.sh
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]$(__git_ps1 " \[\033[00;31m\](%s)\[\033[00m\]")\$ '
@marc0der
marc0der / gist:1423003
Created December 2, 2011 12:03
Who needs Time Machine?
tar zcvf - /home/dude | ssh dude@backupserver "cat > /backup/dude.tar.gz"