Skip to content

Instantly share code, notes, and snippets.

View ludovicc's full-sized avatar
🎯
Focusing

Ludovic Claude ludovicc

🎯
Focusing
View GitHub Profile
@virattt
virattt / agent_with_custom_tool.ipynb
Last active March 23, 2024 15:30
agent_with_custom_tool.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import zio.*
import zio.prelude.*
import zio.prelude.fx.*
object BaseSyntax:
type Program[S, R, E, A] = ZPure[Nothing, S, S, R, E, A]
type LoggedProgram[W, S, R, E, A] = ZPure[W, S, S, R, E, A]

Fibers

Fibers are an abstraction over sequential computation, similar to threads but at a higher level. There are two ways to think about this model: by example, and abstractly from first principles. We'll start with the example.

(credit here is very much due to Fabio Labella, who's incredible Scala World talk describes these ideas far better than I can)

Callback Sequentialization

Consider the following three functions

@ChristopherDavenport
ChristopherDavenport / Libraries.md
Last active February 1, 2024 11:38
A Current Listing of Libraries
@jbsarrodie
jbsarrodie / Sync Model from CSV.ajs
Last active December 24, 2021 13:18
#jArchi scripts to sync (some) model concepts from one or more CSV files
// Sync Model from CSV.ajs
//
// Requires jArchi - https://www.archimatetool.com/blog/2018/07/02/jarchi/
//
// This script allows easy integration of data coming from other systems through CSV files.
// Each CSV file is described through a configuration object that you can later load and sync.
// Most of the mapping informations (Id, Name, Documentation, Properties...) can be expressed through
// the name of a column from the CSV file or through a function (which allows more advanced computation).
//
// Dataset used as example comes from https://datahub.io/core/country-codes
@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

@0x0efe
0x0efe / .vimrc
Last active April 27, 2022 09:34
Vim configuration with Scala Metals
" Personal settings
syntax on
set number
set relativenumber
set ruler
set cursorline
set modeline
set vb
set incsearch
@AndersonTorres
AndersonTorres / nix-development-template-file.org
Last active September 27, 2021 21:01
A project workflow for Nixpkgs/NixOS

Standard project structure

This is a project structure I’ve found useful. Looking for any thoughts/comments/feedback. Roughly, I found a tension between the style nixpkgs expects and the style conducive to development, so I extracted the common portion into a derivation.nix which is used by the remaining .nix files. This setup allows me to use nix build, nix-shell, overlays, Hydra, alternate packaging schemes, cross-compiling, etc.

@FlorianHeigl
FlorianHeigl / cheatsheets.md
Last active June 21, 2024 02:41
Printable Cheat Sheets for Software

A collection of links to useful cheat sheets.

Only what's properly printable can get a spot at the top of this list. It should also be small enough to fit on a few pages. almost all links in this document were designed by their creators so that YOU can print them in a good-looking format and store them however is best for you. Anything that isn't really something you could print in A4/UfS Letter format, but is still a well-made cheatsheet can get a spot at the end of the page.

Pleae contribute any you remember you've seen and liked. It would be wonderful if we can get these to be something more commonly made.

Search Engines

@dusenberrymw
dusenberrymw / spark_tips_and_tricks.md
Last active June 28, 2024 12:37
Tips and tricks for Apache Spark.

Spark Tips & Tricks

Misc. Tips & Tricks

  • If values are integers in [0, 255], Parquet will automatically compress to use 1 byte unsigned integers, thus decreasing the size of saved DataFrame by a factor of 8.
  • Partition DataFrames to have evenly-distributed, ~128MB partition sizes (empirical finding). Always err on the higher side w.r.t. number of partitions.
  • Pay particular attention to the number of partitions when using flatMap, especially if the following operation will result in high memory usage. The flatMap op usually results in a DataFrame with a [much] larger number of rows, yet the number of partitions will remain the same. Thus, if a subsequent op causes a large expansion of memory usage (i.e. converting a DataFrame of indices to a DataFrame of large Vectors), the memory usage per partition may become too high. In this case, it is beneficial to repartition the output of flatMap to a number of partitions that will safely allow for appropriate partition memory sizes, based upon the