Skip to content

Instantly share code, notes, and snippets.

@akomakom
akomakom / SemVer.groovy
Last active February 1, 2024 19:58 — forked from michaellihs/SemVer.groovy
Semantic Versioning class for Groovy
/**
* This evolved from pure SemVer to any-length version with optional -suffix
* accepts any of:
* 1
* 1.2
* 1.2.3
* 1.2.3.4 (etc, no limit)
* 1.2.3-SNAPSHOT
*
* bump() also accepts index values, eg -1 (last component), -2 (second from end), etc:
@wdullaer
wdullaer / install.sh
Last active April 2, 2024 20:33
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@thomd
thomd / path.sh
Last active August 24, 2017 00:10
path manipulation functions for the bash
# Path Manipulation Functions (by @rtomayko)
# List path entries of PATH or environment variable <var>.
# Usage: pls [<var>]
pls () { eval echo \$${1:-PATH} |tr : '\n'; }
# Shift <num> entries off the front of PATH or environment var <var>.
# with the <var> option.
# Usage: pshift [-n <num>] [<var>]
# Useful: pshift $(pwd)
@mr-rock
mr-rock / sinatra_jquery_test.rb
Created October 9, 2009 11:40
An example of Sinatra working with Ajaxified JQuery based on some pieces of code published by Rafael George on the Sinatra Google Group.
require 'sinatra'
require 'dm-core'
require 'haml'
DataMapper.setup(:default, 'sqlite3::memory:')
class Message
include DataMapper::Resource
property :id, Serial