Skip to content

Instantly share code, notes, and snippets.

View dacr's full-sized avatar
🕷️

Crosson David dacr

🕷️
View GitHub Profile
@dacr
dacr / default.nix
Created May 25, 2024 10:20
extract text from an image / published by https://github.com/dacr/code-examples-manager #ae050f30-f03b-4549-93df-b08c6a4de460/dd20cd60093bc99d2b46920a570703b14410a5f1
{ pkgs ? import <nixpkgs> {}
}:
pkgs.mkShell {
name = "tesseract-env-shell";
buildInputs = with pkgs; [
tesseract
];
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.tesseract}/lib
export TESSDATA_PREFIX=${pkgs.tesseract}/share/tessdata
@dacr
dacr / default.nix
Created May 25, 2024 10:18
extract text from a photo / published by https://github.com/dacr/code-examples-manager #94a20658-f287-42cd-8410-6ecf90b7c661/3fd5d6040f2203c86c9975eee8ad444bde13b263
{ pkgs ? import <nixpkgs> {}
}:
pkgs.mkShell {
name = "tesseract-env-shell";
buildInputs = with pkgs; [
tesseract
];
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.tesseract}/lib
export TESSDATA_PREFIX=${pkgs.tesseract}/share/tessdata
@dacr
dacr / tapir-zio-stream.sc
Last active May 25, 2024 08:38
Streamed hello world / published by https://github.com/dacr/code-examples-manager #ee6c3275-18d1-4651-a6fa-7b27371d09b2/72869f114f00b13635b288971d2236a23db898c5
// summary : Streamed hello world
// keywords : scala, zio, tapir, http, zhttp, stream, @testable, @exclusive
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : ee6c3275-18d1-4651-a6fa-7b27371d09b2
// created-on : 2024-05-15T09:53:10+02:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
// test-with : curl http://127.0.0.1:8080/hello
@dacr
dacr / scala3-feature-macro-3-inline-if.scala
Last active May 25, 2024 10:18
scala3 feature examples - macros - inline if / published by https://github.com/dacr/code-examples-manager #2caea6b8-340f-45a1-923c-ac671afb6491/f6e64dc8fb4fa2b967dc83f3be2dbe7edaa5bfb9
// summary : scala3 feature examples - macros - inline if
// keywords : scala3, tutorial, macros, inline, meta-programming, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 2caea6b8-340f-45a1-923c-ac671afb6491
// created-on : 2024-03-17T08:46:55+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@dacr
dacr / scala3-feature-macro-4-inline-matches.scala
Last active May 25, 2024 10:18
scala3 feature examples - macros - inline matches / published by https://github.com/dacr/code-examples-manager #d1f6d051-2dd9-4fbb-bf5a-dc855cd17c47/c6f7d05e5d86fea17b73adc7fe43167eb8ff45e2
// summary : scala3 feature examples - macros - inline matches
// keywords : scala3, tutorial, macros, inline, meta-programming, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : d1f6d051-2dd9-4fbb-bf5a-dc855cd17c47
// created-on : 2024-03-17T11:11:11+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@dacr
dacr / scala3-feature-macro-5-programs-as-values.scala
Last active May 25, 2024 10:20
scala3 feature examples - macros - programs as values / published by https://github.com/dacr/code-examples-manager #9073c9cf-9998-4ee6-983f-fbe3acf48d94/65771286c6105a3b9576dcc5ae0267aba65a373d
// summary : scala3 feature examples - macros - programs as values
// keywords : scala3, tutorial, macros, inline, meta-programming, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 9073c9cf-9998-4ee6-983f-fbe3acf48d94
// created-on : 2024-03-17T11:11:11+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@dacr
dacr / scala3-feature-macro-0-simple.scala
Last active May 25, 2024 10:19
scala3 feature examples - macros - inline / published by https://github.com/dacr/code-examples-manager #7919a7e2-aafd-4f7f-9702-acd157ef9bfc/3ae11f83aec4e2fbb6dc15f772125a9241ee9da7
// summary : scala3 feature examples - macros - inline
// keywords : scala3, tutorial, macros, inline, meta-programming, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 7919a7e2-aafd-4f7f-9702-acd157ef9bfc
// created-on : 2024-03-17T08:32:29+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@dacr
dacr / iron-basic.sc
Last active May 25, 2024 10:19
iron refined type simplest usage example / published by https://github.com/dacr/code-examples-manager #355b00cf-7e9a-47ca-93c7-8c76a36d71cc/2326ca208b6b3df5ed8fe7273afa2bb42f0be08
// summary : iron refined type simplest usage example
// keywords : scala, iron, refined, @testable
// publish : gist
// authors : chimney
// license : Apache2
// id : 355b00cf-7e9a-47ca-93c7-8c76a36d71cc
// created-on : 2024-02-16T08:42:10+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@dacr
dacr / scala3-feature-macro-2-inline-def.scala
Last active May 25, 2024 10:19
scala3 feature examples - macros - inline def / published by https://github.com/dacr/code-examples-manager #4dc9d4a2-bd4a-4f02-abea-29412c842854/8b6d884de652ace920daab6fba40f74acddd149e
// summary : scala3 feature examples - macros - inline def
// keywords : scala3, tutorial, macros, inline, meta-programming, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 4dc9d4a2-bd4a-4f02-abea-29412c842854
// created-on : 2024-03-17T08:18:10+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file
@dacr
dacr / djl-gpu-info.sc
Last active May 25, 2024 10:20
get some gpu information / published by https://github.com/dacr/code-examples-manager #2823b304-e6a7-47fb-80b2-4ca33fb3cc3d/5d5ff6a93ed7dd68bda667dff51a90b8980b8791
// summary : get some gpu information
// keywords : djl, machine-learning, gpu, @testable
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : 2823b304-e6a7-47fb-80b2-4ca33fb3cc3d
// created-on : 2024-02-18T11:58:44+01:00
// managed-by : https://github.com/dacr/code-examples-manager
// run-with : scala-cli $file