Skip to content

Instantly share code, notes, and snippets.

View ethauvin's full-sized avatar

Erik C. Thauvin ethauvin

View GitHub Profile
@ethauvin
ethauvin / 0.linux.md
Last active May 14, 2024 02:55
linux snippets

A collection of Linux snipets.

@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.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 / AndroidPreferences.kt
Last active January 18, 2018 14:04
Android SharedPreferences shorthands for Kotlin
import android.content.Context
import android.content.SharedPreferences
import android.preference.PreferenceManager
fun Context.getDefaultSharedPreferences(): SharedPreferences {
return PreferenceManager.getDefaultSharedPreferences(this)
}
fun SharedPreferences.clear() {
edit().clear().apply()
@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 / 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 / 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 / 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