Skip to content

Instantly share code, notes, and snippets.

@friederbluemle
friederbluemle / gist:25821a42a2eab20562b7
Created July 29, 2014 06:59
Manually add dependencies to pom.xml when using maven-publish plugin
publishing {
publications {
maven(MavenPublication) {
// ...
// Manually add dependencies to pom until maven-publish knows how to do it
pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')
//Iterate over the compile dependencies (we don't want the test ones), adding a <dependency> node for each
@friederbluemle
friederbluemle / gist:0e15718dd84b5d34400c
Created August 8, 2014 06:08
Gradle versioning using Git tags
def getGitDescribe = { ->
return 'git describe --tags --dirty'.execute().text.trim()
}
def isSnapshotBuild = { ->
def hasModifiedDeletedOrOtherFiles = !'git ls-files -mdo --exclude-standard'.execute().text.trim().isEmpty()
def hasStagedFiles = !'git diff-index --no-ext-diff --name-only --cached HEAD'.execute().text.trim().isEmpty()
def hasAdditionalCommits = getGitDescribe().contains('-')
hasModifiedDeletedOrOtherFiles || hasStagedFiles || hasAdditionalCommits
}
var request = require('request');
var apiKey = "API_KEY";
var regId = "REG_ID";
var args = process.argv.slice(2);
if (args[0] == 'show_offers') {
var data = {
id: Math.floor(Date.now() / 1000),

Keybase proof

I hereby claim:

  • I am friederbluemle on github.
  • I am friederbluemle (https://keybase.io/friederbluemle) on keybase.
  • I have a public key ASAivIza2aMl4EHXW2pXE7TSHIghuS3AghQWN8WLqtKSPQo

To claim this, I am signing this object:

Verifying my Blockstack ID is secured with the address 1ESjwWJe3QbFWTuqPWRXChH4DvHa2h3Tf4 https://explorer.blockstack.org/address/1ESjwWJe3QbFWTuqPWRXChH4DvHa2h3Tf4
@friederbluemle
friederbluemle / build.gradle
Created January 17, 2020 21:24
Simple minimal Android Gradle <-> Git tag version mapping
android {
// ...
defaultConfig {
def gitDescribe = "git -C ${rootDir} describe --tags --long --dirty".execute().text.trim()
def (tag, commitsString, commitSha, dirty) = gitDescribe ? gitDescribe.tokenize('-') : []
def (tagMajor, tagMinor, tagPatch) = tag ? tag.tokenize('.') : []
def commits = commitsString ? commitsString.toInteger() : 0
def tmpMajor = tagMajor ? tagMajor.replaceAll('^v', '') : ''
def major = (tmpMajor && tmpMajor.isNumber()) ? tmpMajor.toInteger() : 0
def minor = (tagMinor && tagMinor.isNumber()) ? tagMinor.toInteger() : 0
@friederbluemle
friederbluemle / man-du-gnu-coreutils-8.32.txt
Created April 4, 2020 20:25
`MANWIDTH=100 man du | col -bx` on Arch Linux with GNU coreutils 8.32
DU(1) User Commands DU(1)
NAME
du - estimate file space usage
SYNOPSIS
du [OPTION]... [FILE]...
du [OPTION]... --files0-from=F
DESCRIPTION
@friederbluemle
friederbluemle / man-du-macos-10.15.4.txt
Last active April 4, 2020 20:25
`MANWIDTH=100 man du | col -bx` on macOS 10.15.4 (19E266)
DU(1) BSD General Commands Manual DU(1)
NAME
du -- display disk usage statistics
SYNOPSIS
du [-H | -L | -P] [-a | -s | -d depth] [-c] [-h | -k | -m | -g] [-x] [-I mask]
[file ...]