Skip to content

Instantly share code, notes, and snippets.

View h2000's full-sized avatar

Alf Richter h2000

  • iba Consulting Gesellschaft
  • Germany/Leipzig
View GitHub Profile
@smores56
smores56 / weaver-talk.md
Last active May 7, 2024 04:49
Presentation slides for my talk about github.com/smores56/weaver

Weaver

An ergonomic arg parsing library for the Roc programming language.


Table of Contents

  • Introductions
  • Why did I want to make this library?
@gmk57
gmk57 / CoroutineTimer.kt
Last active April 30, 2024 09:36
Coroutine-based solution for delayed and periodic work
/**
* Coroutine-based solution for delayed and periodic work. May fire once (if [interval] omitted)
* or periodically ([startDelay] defaults to [interval] in this case), replacing both
* `Observable.timer()` & `Observable.interval()` from RxJava.
*
* In contrast to RxJava, intervals are calculated since previous run completion; this is more
* convenient for potentially long work (prevents overlapping) and does not suffer from queueing
* multiple invocations in Doze mode on Android.
*
* Dispatcher is inherited from scope, may be overridden via [context] parameter.
@gmk57
gmk57 / RunRetrying.kt
Last active December 6, 2022 19:23
Coroutine-based solution for retries with delay
/**
* Analogue of [runCatching] with retry, delay & logging added.
* Re-throws CancellationException to avoid the need to explicitly skip it in [onFailure].
* Intervals are calculated since previous failure.
*/
@ExperimentalTime
suspend fun <T> runRetrying(
times: Int,
interval: Duration,
name: String,
@jiffle
jiffle / strikt-cheatsheet.md
Last active March 2, 2023 15:44
Strikt Cheatsheet

Tricks and tips for using Strikt assertions

Strikt is very powerful, however it is sometimes hard to find particular methods. This is a handy cheatsheet.

Basics

Top-level assertions

expect, expectThat, expectCatching and expectThrows

@dacr
dacr / index.md
Last active June 28, 2024 23:14
David's programming examples knowledge base / published by https://github.com/dacr/code-examples-manager #fecafeca-feca-feca-feca-fecafecafeca/207c50c8da525812363701a12ee72e8eb9151628

David's programming examples knowledge base

akka-pekko

@JoelQ
JoelQ / elm-types-glossary.md
Last active June 26, 2024 03:05
Elm Type Glossary

Elm Types Glossary

There's a lot of type terminology and jargon going around when discussing types in Elm. This glossary attempts to list some of the most common type terms along with synonyms, terms from other language communities, examples, and links to more detailed articles on each topic.

@amake
amake / innosetup-linux-macos.org
Last active July 2, 2024 15:48
Inno Setup on Linux and macOS

Inno Setup on Linux and macOS

Inno Setup is a popular installer builder for Windows. Of course it is made to run on Windows only, by default. But what if you want to build Windows installers off Windows, i.e. on Linux or macOS?

You’re in luck: It’s possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

@oshai
oshai / scala-to-kotlin.kts
Last active February 9, 2023 10:45
Stupid and simple convert a Scala file (already renamed to .kt extension) to Kotlin
#!/usr/bin/env kscript
import java.io.File
// usage - one argument a .kt file (Scala file that was only renamed)
// or a directory
try {
main(args)
} catch (e: Exception) {
e.printStackTrace()
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@480
480 / gist:3b41f449686a089f34edb45d00672f28
Last active July 3, 2024 03:59
MacOS X + oh my zsh + powerline fonts + visual studio code terminal settings

MacOS X + oh my zsh + powerline fonts + visual studio code (vscode) terminal settings

Thank you everybody, Your comments makes it better

Install oh my zsh

http://ohmyz.sh/

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"