GitHub recently added support for including Mermaid diagrams in Markdown files. The good news is that it works for AsciiDoc files as well. Here is an example:
sequenceDiagram
participant Alice
participant Bob
package demo | |
import arrow.core.Either | |
import arrow.core.None | |
import arrow.core.Option | |
import arrow.core.Some | |
import arrow.core.continuations.Raise | |
import arrow.core.continuations.effect | |
import arrow.core.continuations.either | |
import arrow.core.continuations.toEither |
GitHub recently added support for including Mermaid diagrams in Markdown files. The good news is that it works for AsciiDoc files as well. Here is an example:
sequenceDiagram
participant Alice
participant Bob
// Save as ~/.ammonite/predef.sc | |
// To use fs2 from ammonite repl, type `load.fs2` from repl prompt. | |
// You'll get all fs2 & cats imports, ContextShift and Timer instances | |
// for IO, and a globalBlocker | |
import $plugin.$ivy.`org.typelevel:::kind-projector:0.11.0` | |
if (!repl.compiler.settings.isScala213) | |
repl.load.apply("interp.configureCompiler(_.settings.YpartialUnification.value = true)") |
I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
# NVM | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
nvm install 10 | |
# Yarn | |
curl -o- -L https://yarnpkg.com/install.sh | bash | |
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" |
This NixOS code ensures that the system provide version-specific $LOCALE_ARCHIVE
environment variables to mitigate the effects of
NixOS/nixpkgs#38991.
To deploy it, copy the file into your /etc/nixos
folder using a file name
like multi-glibc-locale-paths.nix
. Then edit your configuration.nix
file to
contain the attribute:
imports = [ ./multi-glibc-locale-paths.nix ];
-- Adapted from these sources: | |
-- http://peterdowns.com/posts/open-iterm-finder-service.html | |
-- https://gist.github.com/cowboy/905546 | |
-- https://gist.github.com/ttimasdf/7bb02ed419db4b472b534e1a57008a3b | |
-- | |
-- Modified to work with files as well, cd-ing to their container folder | |
on run {input, parameters} | |
tell application "Finder" | |
set my_file to first item of input | |
set is_folder to (do shell script "file -b " & quoted form of (POSIX path of my_file)) |
import scalaz._ | |
import scalaz.concurrent.Task | |
def signal(i: Int): Task[Int] = | |
Task.async[Int] { cb => cb(\/-(i)) } | |
def loop(n: Int, acc: Int): Task[Int] = | |
signal(acc + n).flatMap { x => | |
if (n <= 0) Task.now(acc) | |
else loop(n-1, x) |