Skip to content

Instantly share code, notes, and snippets.

View tanfonto's full-sized avatar
🚫
moved to Codeberg

moved to Codeberg tanfonto

🚫
moved to Codeberg
  • Warsaw, Poland
View GitHub Profile
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active June 18, 2024 11:27
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@ghulette
ghulette / args.ml
Created May 1, 2017 17:54
Labeled and optional arguments in OCaml, by example
open Printf
(* Labeled arguments, the easy way *)
let _ =
(* Declare a function with labeled arguments like this: *)
let f ~x ~y = x + y in
(* Type: f : x:int -> y:int -> int *)
(* Call it like this: *)
printf "%d\n" (f ~x:5 ~y:6);
@GeorgeLyon
GeorgeLyon / Rust vs. Swift.md
Last active July 21, 2024 08:57
A list of advantages Swift has over Rust

Note This is a little out of date. Rust has made some progress on some points, however many points still apply.

Philosophy

Progressive disclosure

Swift shares Rust's enthusiasm for zero-cost abstractions, but also emphasizes progressive disclosure. Progressive disclosure requires that language features should be added in a way that doesn't complicate the rest of the language. This means that Swift aims to be simple for simple tasks, and only as complex as needed for complex tasks.

The compiler works for you

@sleepyfox
sleepyfox / 2022-06-22-the-problem-with-AI-coders.md
Created January 9, 2023 13:12
The problem with AI coders
author: @sleepyfox
title: The problem with AI coders
date: 22-Jun-2022

The problem with AI coders

The problem with 'solutions' like GitHub's Copilot, and similar tech, is that it frames the problem as a problem of search. The programmer is searching for some code that does a thing (produce a HTML table with alternating coloured background rows of green and red), and that they just need to find that thing. Machine Learning has had success in this area, just look at Google's page-rank 'algorithm'.