Skip to content

Instantly share code, notes, and snippets.

View aconstantin's full-sized avatar

Alexander Constantin aconstantin

  • Frankfurt, Germany
View GitHub Profile
@ArchTest
public static final ArchRule exercise2 =
classes().that().haveSimpleNameEndingWith("Service")
.and()
.implement(HasName.Predicates.nameEndingWith("UseCase"))
.should().beAnnotatedWith(UseCase.class);
@ArchTest
public static final ArchRule exercise2a =
classes().that().haveSimpleNameEndingWith("Service")

Delete all remote branches from renovate

git branch -r | awk -F/ '//renovate/{print $2"/"$3}' | xargs -I {} git push origin :{}

@aconstantin
aconstantin / useful-docker-commands.md
Created January 23, 2021 21:40
useful docker commands

Cleanup all Images

Remove all stopped containers

docker container prune

Remove all unused images, not just dangling ones

docker image prune -a

@aconstantin
aconstantin / create-timelapse.sh
Last active December 15, 2020 19:55
Timelapse Video
# downscale
find . -type f -name "*.jpg" -exec convert {} -resize 1920x1920 /volume1/media/new_content/2016timelapse_1080p/{} \;
# create video with framerate 16
ffmpeg -framerate 16 -i timelapse_%05d.jpg -vf format=yuv420p 16pfs_output.mp4
#!/bin/sh
INPUT=$1
if [ ! -f "${INPUT}" ]; then
echo "[${INPUT}] File not found!"
exit 1
fi
METADATA_KEY="TAG:com.apple.quicktime.creationdate"

Keybase proof

I hereby claim:

  • I am aconstantin on github.
  • I am aconstan (https://keybase.io/aconstan) on keybase.
  • I have a public key whose fingerprint is 3550 1590 94D5 AD1A 2472 7C43 CB87 C895 F0DE E0BD

To claim this, I am signing this object:

@aconstantin
aconstantin / gist:5297c134585af1e93968
Created July 15, 2015 06:22
Sample Spring Boot control.sh script
#!/bin/sh
PROJECT_NAME=some-project
BASE_PATH=${HOME}/${PROJECT_NAME}
PID_FILE=$BASE_PATH/application.pid
SB_PORT=8080
SB_PROFILES="foo,bar"
@aconstantin
aconstantin / gist:6563364
Created September 14, 2013 16:27
Getting Input from Console in Gradle Build
import org.gradle.plugins.signing.Sign
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
// Use Java 6's console to read from the console (no good for a CI environment)
Console console = System.console()
console.printf "\n\nWe have to sign some things in this build.\n\nPlease enter your signing details.\n\n"
def id = console.readLine("PGP Key Id: ")
def file = console.readLine("PGP Secret Key Ring File (absolute path): ")
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
import liquibase.integration.commandline.Main
apply plugin: LiquibasePlugin
buildscript {