Skip to content

Instantly share code, notes, and snippets.

View ethauvin's full-sized avatar

Erik C. Thauvin ethauvin

View GitHub Profile
@ethauvin
ethauvin / gmail-keywords.txt
Last active April 26, 2024 07:27
Gmail Keywords
from:
to:
subject:
OR
- (hyphen)
label:
has:attachment
list:
filename:
" " (quotes)
@ethauvin
ethauvin / 0.linux.md
Last active September 13, 2024 09:40
linux snippets

A collection of Linux snipets.

@ethauvin
ethauvin / 0.ubuntu.md
Last active December 5, 2023 19:40
ubuntu snippets

A collection of Ubuntu snippets.

@ethauvin
ethauvin / 0.git.md
Last active January 19, 2022 23:27
git snippets

A collection of Git snippets.

@ethauvin
ethauvin / pom2xml.kt
Created January 3, 2018 22:42
pom2xml 0.1 example
import net.thauvin.erik.kobalt.plugin.pom2xml.*
val bs = buildScript {
plugins("net.thauvin.erik:kobalt-pom2xml:")
}
val p = project {
name = "example"
group = "com.example"
artifactId = name
@ethauvin
ethauvin / version.properties
Last active April 27, 2017 06:02
Version Properties file for Semantic Annotation Processor
# version.properties
version.major=1
version.minor=0
version.patch=0
version.prerelease=beta
@ethauvin
ethauvin / SemverExample.java
Last active April 27, 2017 06:03
Using a mustache template with the Semantic Annotation Processor
import net.thauvin.erik.semver.Version;
@Version(template = "version.mustache")
public class SemverExample {
// ...
}
@ethauvin
ethauvin / SemverExample.java
Last active April 27, 2017 06:05
Using a properties file with the Semantic Annotation Processor
import net.thauvin.erik.semver.Version;
@Version(properties = "version.properties")
public class SemverExample {
// ...
}
@ethauvin
ethauvin / SemverExample.java
Last active April 27, 2017 06:04
Using annotation elements with Semantic Annotation Processor
import net.thauvin.erik.semver.Version;
@Version(major = 1, minor = 0, patch = 0, preRelease = "beta")
public class SemverExample {
// ..
}
@ethauvin
ethauvin / Plural.kt
Created August 28, 2016 07:26
Pluralize a string
fun String.plural(size: Int): String {
val consonants = "bcdfghjklmnpqrstvwxz"
if (size > 1 && this.length > 2) {
if ((this.endsWith("o", true) || this.endsWith("s", true)) &&
consonants.contains(this[this.length - 2], true)) {
return this + "es"
}
if (this.endsWith("y", true) &&