Skip to content

Instantly share code, notes, and snippets.

Mikael Östberg O5ten

Block or report user

Report or block O5ten

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
O5ten / git-branch
Created Dec 16, 2014
Show current branch in Bash
View git-branch
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/'
PS1="$PS1\$(parse_git_branch)$ "
View gist:22f9f9d3aea81ebb73dd
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.
View gist:0dcb7580610320e34abd
validator: { v ->
v = parseInt(v)
} catch (NumberFormatException e) {
field.background = Color.RED
return false
if (v >= 0 && v < MAX_VALUE) {
field.background = Color.WHITE
View Gewdis!
public ProjectBlueprint scenario(ScenarioBlueprint... scenarioBlueprints) {
Collections.addAll(this.scenarios, scenarioBlueprints);
return this;
View gist:796dd06fb2f5732bada6
private void verifyObjectIsValid() {
Object object = test.getFacade().getObject();
if (object.getObject() == null || object.getAnotherObject() == null) {
throw new IllegalStateException("Object: Invalid object: object=" + object.getAnotherObject()
+ ", Load Profile: " + object.getObject());
View gist:2cd057e0878b5978a038
- Överdel
- Underdel
- Skaljacka // Vindtät iallafall
- Täckbyxor
- Handskar // som inte drar till sig snö
O5ten / gist:892508ff077ebff571b9d5f17c5a0f89
Created Mar 30, 2016
indexOf by condition instead of deep-equal
View gist:892508ff077ebff571b9d5f17c5a0f89
indexOf = function(collection, condition){
if(collection && Array.isArray(collection) && condition){
for(var i = 0; i < collection.length; i+=1){
return i;
return -1;
O5ten /
Last active Jul 6, 2016
Run testsuite quickly in browser
if [ ! -d ui/$library ]; then
echo "Directory ui/$library does not exist"
exit 1
O5ten / settings.xml
Created Jul 28, 2017
My most common settingsfile for maven
View settings.xml
<settings xmlns=""
O5ten / In-build-selenium-server-with-dynamic-port-allocation-maven-profile.xml
Last active Sep 19, 2017
In-build selenium-server to run your tests headless in any operating system.
View In-build-selenium-server-with-dynamic-port-allocation-maven-profile.xml
You can’t perform that action at this time.