Skip to content

Instantly share code, notes, and snippets.

View O5ten's full-sized avatar

Mikael Östberg O5ten

View GitHub Profile
@O5ten
O5ten / Gewdis!
Created December 18, 2014 09:40
Gewdis!
@Override
public ProjectBlueprint scenario(ScenarioBlueprint... scenarioBlueprints) {
Collections.addAll(this.scenarios, scenarioBlueprints);
return this;
}
validator: { v ->
try{
v = parseInt(v)
} catch (NumberFormatException e) {
field.background = Color.RED
field.revalidate()
return false
}
if (v >= 0 && v < MAX_VALUE) {
field.background = Color.WHITE
@O5ten
O5ten / git-branch
Created December 16, 2014 15:48
Show current branch in Bash
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
}
PS1="$PS1\$(parse_git_branch)$ "
@O5ten
O5ten / gist:22f9f9d3aea81ebb73dd
Created December 16, 2014 15:03
push.defaults
nothing - do not push anything.
matching - push all matching branches. All branches having the same name in both ends are considered to be matching. This is the default.
upstream - push the current branch to its upstream branch.
tracking - deprecated synonym for upstream.
current - push the current branch to a branch of the same name.