Skip to content

Instantly share code, notes, and snippets.

View theSmokingFrog's full-sized avatar
🥃
6 hours of debugging can save 5 minutes of reading documentation.

Nils Hoffmann theSmokingFrog

🥃
6 hours of debugging can save 5 minutes of reading documentation.
  • GOD mbH
  • Braunschweig
View GitHub Profile
@theSmokingFrog
theSmokingFrog / delete-screenshots-older-30-days.sh
Created May 2, 2022 12:17
[Deletion Screenshots older than 30 days] Bash Script to delete files in the screenshot directory which are older than 30 days. This is executed via cron on my machine. #cron #bash #shell #macos
#!/usr/bin/env bash
# - Easy Configuration --------------------------------------------
SCREENSHOT_DIR=/Users/nhoffmann/Screenshots
OLDER_THAN_DAYS=30
# - Additional Software -------------------------------------------
# → Ensures that the software can be executed from the CRON Job
# see https://github.com/julienXX/terminal-notifier
NOTIFIER=/usr/local/bin/terminal-notifier
@theSmokingFrog
theSmokingFrog / browser-support.html
Created September 2, 2021 13:11
[Lightweight Browser Support Checking] An easily extendable way to check for the support of a given Browser. The script can be included within the body of the root HTML file and will load the referenced page when a browser is not supported #javascript #angular
<div style="height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center">
<h1 style="font-size: 5em">Unsupported Browser</h1>
</div>

CSS Gradient Clip-Path Borders

This pen shows how the CSS clip-path property can be used to create a variety of shaped gradient borders.

A Pen by Nils Hoffmann on CodePen.

License.

@theSmokingFrog
theSmokingFrog / glitching-text-scss.markdown
Last active June 15, 2021 13:28
[Glitching Text] Glitching Text effect with SCSS and HTML #scss #design #texteffects

Glitching Text (SCSS)

A simple solution to creating a glitched text solution using only one text tag and some SCSS, using randomized animations. Commented for easy viewing.

A Pen by Nils Hoffmann on CodePen.

License.

@theSmokingFrog
theSmokingFrog / jvm-arguments.md
Created May 10, 2021 19:26
[JVM Arguments for System Keystore] A list of JVM arguments for using the systems certificate stores. In my case mainly used for configuration of different repositories in IDEs #configuration #java

macOS

-Djavax.net.ssl.trustStoreType=KeychainStore
-Djavax.net.ssl.trustStoreProvider=Apple

Windows

-Djavax.net.ssl.trustStoreProvider=SunMSCAPI
-Djavax.net.ssl.trustStoreType=Windows-ROOT
@theSmokingFrog
theSmokingFrog / ObjectValidationException.java
Created May 10, 2021 19:20
[Simple Fluent Validator] A simple fluent validator for verifiying customizable rules on different classes #java #validation #lombok
package de.god.foss4all.maven.plugin.validator;
import java.text.MessageFormat;
/**
* Exception if object validation is fail in {@link ObjectValidator}.
*/
public class ObjectValidationException extends RuntimeException
{
/**
@theSmokingFrog
theSmokingFrog / dockicon.java
Created February 19, 2021 10:21 — forked from bchapuis/dockicon.java
Mac osx java application dock icon
try {
Class util = Class.forName("com.apple.eawt.Application");
Method getApplication = util.getMethod("getApplication", new Class[0]);
Object application = getApplication.invoke(util);
Class params[] = new Class[1];
params[0] = Image.class;
Method setDockIconImage = util.getMethod("setDockIconImage", params);
URL url = App.class.getClassLoader().getResource("icon.png");
Image image = Toolkit.getDefaultToolkit().getImage(url);
setDockIconImage.invoke(application, image);
@theSmokingFrog
theSmokingFrog / app.module.ts
Created January 19, 2021 11:41
[Angular 8 - Loading indicator] Interceptor and Service to be used in combination to show some kind of indicator that HTTP requests are running #angular
@NgModule({
imports: [ /* ... */ ],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: GlobalHttpInterceptor,
multi: true
}
],
bootstrap: [AppComponent]
@theSmokingFrog
theSmokingFrog / listToMap.java
Last active June 15, 2021 13:19
[List to Map with Index as Key] Example on how to use streams to convert a List to a Map using an IntStream as Index #streams
class ListToMap
{
public static <TYPE> Map<Integer, TYPE> convert(final List<TYPE> pList)
{
return IntStream.range(0, pList.size())
.boxed()
.collect(Collectors.toMap(Function.identity(), pList::get));
}
}
@theSmokingFrog
theSmokingFrog / typed-text-template.html
Last active June 15, 2021 13:22
Text Typing Effect Example in SCSS
<div class="center-wrapper">
<span class="is-typed">
Hello World!
</span>
</div>