Skip to content

Instantly share code, notes, and snippets.

View etorreborre's full-sized avatar
🏠
Working from home

Eric Torreborre etorreborre

🏠
Working from home
View GitHub Profile
@etorreborre
etorreborre / latency.txt
Created December 17, 2025 09:53 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@etorreborre
etorreborre / manifest.lock
Created December 30, 2024 15:27
flox attempt to install stack
{
"lockfile-version": 1,
"manifest": {
"version": 1,
"install": {
"cabal-install": {
"pkg-path": "cabal-install"
},
"ghc": {
"pkg-path": "ghc"
@etorreborre
etorreborre / flox-1.3.8-activation
Created December 28, 2024 16:01
flox-1.3.8 activation with direnv
2024-12-28T15:58:44.713835Z DEBUG flox: set _FLOX_PKGDB_VERBOSITY=3
2024-12-28T15:58:44.715656Z DEBUG flox::config: reading raw config (initialized: true, reload: false)
2024-12-28T15:58:44.718015Z DEBUG flox::commands: Skipping update check in development mode
2024-12-28T15:58:44.718371Z DEBUG flox::commands: Metrics collection disabled
2024-12-28T15:58:44.719836Z DEBUG flox::utils::init::catalog_client: using catalog client with url: https://api.flox.dev
2024-12-28T15:58:44.725297Z DEBUG flox::utils::init::metrics: Attempting to read own UUID from file
2024-12-28T15:58:44.725645Z TRACE flox_command: subcommand="activate"
2024-12-28T15:58:44.725655Z DEBUG flox::utils::metrics: No metrics client setup, skipping record
2024-12-28T15:58:44.726884Z DEBUG flox::commands: detected concrete environment type: managed
2024-12-28T15:58:44.727338Z DEBUG flox_rust_sdk::models::floxmeta: no FloxHub token configured
@etorreborre
etorreborre / flox-1.3.6-activation
Created December 28, 2024 16:00
flox 1.3.6 activation with direnv
2024-12-28T15:59:18.437238Z DEBUG flox: set _FLOX_PKGDB_VERBOSITY=3
2024-12-28T15:59:18.438991Z DEBUG flox::config: reading raw config (initialized: true, reload: false)
2024-12-28T15:59:18.440693Z DEBUG flox::commands: Metrics collection disabled
2024-12-28T15:59:18.440741Z DEBUG flox::commands: Skipping update check because we can't prompt the user
2024-12-28T15:59:18.441874Z DEBUG flox::utils::init::catalog_client: using catalog client with url: https://api.flox.dev
2024-12-28T15:59:18.446854Z DEBUG flox::utils::init::metrics: Attempting to read own UUID from file
2024-12-28T15:59:18.447053Z TRACE flox_command: subcommand="activate"
2024-12-28T15:59:18.447063Z DEBUG flox::utils::metrics: No metrics client setup, skipping record
2024-12-28T15:59:18.447909Z DEBUG flox::commands: detected concrete environment type: managed
2024-12-28T15:59:18.448152Z DEBUG flox_rust_sdk::models::floxmeta: no FloxHub token configured
@etorreborre
etorreborre / gist:e71d28c35d1142613656a0476a1634ca
Created September 29, 2023 11:08
copy the most recent commit to the clipboard
```
git log -1 --pretty=full | head -1 | awk '{ print $2 }' | pbcopy
```
@etorreborre
etorreborre / generate-ssh-key.sh
Created October 20, 2021 14:09 — forked from denisgolius/generate-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "rthijssen@gmail.com" -f ~/.ssh/mozilla_rsa
@etorreborre
etorreborre / ffunctor.hs
Created October 9, 2021 09:10
Deriving FFunctor?
{-
It would be nice to be able to derive a `FFunctor` instance for some data types as
shown below
-}
class FFunctor f where
ffmap :: (forall a. m a -> n a) -> f m -> f n
-- can we define a default ffmap which would work when m :: Type -> Type?
-- default ffmap
@etorreborre
etorreborre / registry.hs
Last active October 9, 2021 09:10
Dependency injection with registry
{-
See https://www.reddit.com/r/haskell/comments/q1oyws/dependency_injection_using_a_recordoffunctions
for full context
-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveGeneric #-}
@etorreborre
etorreborre / assertions.scala
Created August 16, 2021 11:30
Assertion examples in specs2-5.0.0-RC-03
package examples
import org.specs2.*
class AssertionSpec extends Specification:
def is = s2"""
authors must be correct $book1
authors must be correct $book2
book must be correct $book3
"""
@etorreborre
etorreborre / wishlist-answer.md
Created August 12, 2021 16:43
Response to "My specs(3?) wishlist"

Prescriptive Structural Syntax

I am sorry but I actually prefer the other style of specification! The main reason is that I think that encourages me to think about writing some text about what I am testing, and why I am testing it this way (that doesn't mean that I necessarily do it :-)).

Enforced Matcher Uniformity

I hear you and I indeed simplified all must expressions to be a must b, and then a must not(b).