Skip to content

Instantly share code, notes, and snippets.

View igstan's full-sized avatar

Ionuț G. Stan igstan

View GitHub Profile
@igstan
igstan / clone-gists.sh
Last active January 30, 2026 10:15
Clone all your GitHub gists, public or private.
#!/usr/bin/env bash
source prelude.sh 2>/dev/null || true
# Clones all gists (public or private) into directory `gists/` (auto-created
# and configurable if desired). The cloned gists are placed into directory
# names formed from the name of the first file found in the gist concatenated
# to the gist ID. For example, this gist will be cloned into:
#
# gists/clone-gists.sh-0a89b8bb1a6df0754647cdd87d8221b6
object YAML:
apiVersion:
apps/v1
kind:
Deployment
metadata:
name:
"my-app"
namespace:
"my-app"
@igstan
igstan / lsystem.hs
Created December 12, 2025 12:43 — forked from tonymorris/lsystem.hs
data LSystem a b =
LSystem
[a]
(a -> [b])
type LSystem' a =
LSystem a a
instance Functor (LSystem a) where
fmap k (LSystem a f) =
/**
* DERIVING THE Y COMBINATOR IN 7 EASY STEPS
*
* Ionut G. Stan | ionut.g.stan@gmail.com | http://igstan.ro | http://twitter.com/igstan
*
*
* The Y combinator is a method of implementing recursion in a programming
* language that does not support it natively (actually, it's used more for
* exercising programming brains). The requirement is the language to support
* anonymous functions.
@igstan
igstan / css-3d-transforms.html
Created July 7, 2024 11:46
CSS 3D Transforms & Animations
<!DOCTYPE html>
<!-- Demo: https://www.youtube.com/watch?v=7M9aPgORP_E -->
<html>
<head>
<meta charset="UTF-8">
<title>CSS 3D Transforms &amp; Animations</title>
<style type="text/css">
* {
@igstan
igstan / RecordingApplicative.hs
Last active October 3, 2025 15:04
An Applicative that records the instructions of underlying computations.
{-# LANGUAGE DeriveFunctor #-}
import Control.Applicative
import Control.Monad.Writer
import Control.Monad.Reader
import Control.Monad.Identity
import Data.Map (Map, (!))
import qualified Data.Map as Map
import Data.List (intercalate, nub)
import java.util.HashMap;
public class DoubleBraceInit {
public static void main(String[] args) {
var m1 = new HashMap<>() {{
put("k1", 1);
put("k2", 2);
put("k3", 3);
}};
(* Inspired by: https://www.reddit.com/r/ProgrammingLanguages/comments/1golfwz/emit_a_time_travelling_programming_language/ *)
structure Timewarp =
struct
structure Cont = SMLofNJ.Cont;
type t = unit Cont.cont option ref
fun point () =
let
#!/usr/bin/env -S scala-cli shebang -S 3
/**
* https://www.doc.ic.ac.uk/~eedwards/compsys/float/
*/
import java.{ lang => j }
val n = args(0).toFloat
val bits = j.Float.floatToRawIntBits(n)