Skip to content

Instantly share code, notes, and snippets.

@mawaldne
mawaldne / gist:7831963
Created December 6, 2013 20:56
Kramdown test
require 'kramdown'
puts Kramdown::Document.new(File.open('test.md').read).to_html
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/*
* Keybindings for emacs emulation.
*
* WARNING! After Mountain Lion, this file cannot be symbolic linked to another file,
* you need to put this file in ~/Library/KeyBindings/DefaultKeyBinding.dict directly
*
* Reference:
@mawaldne
mawaldne / gist:6275270
Last active December 21, 2015 07:59
Utility method to update semantic version number. Useful when tagging a new version.
def updateBuildVersion(currentVersion, updateType) {
def versionMatcher = currentVersion =~ /^(\d+)\.(\d+)\.(\d+)$/
def major = versionMatcher[0][1].toInteger()
def minor = versionMatcher[0][2].toInteger()
def patch = versionMatcher[0][3].toInteger()
if (updateType == 'patch')
patch += 1
else if (updateType == 'minor')
minor += 1
@mawaldne
mawaldne / gist:6272854
Last active August 5, 2021 11:33
Read the first line of a file in groovy
def line
new File("test.txt").withReader { line = it.readLine() }
println line