Skip to content

Instantly share code, notes, and snippets.

View coleea's full-sized avatar
💭
I may be slow to respond.

Mario KB coleea

💭
I may be slow to respond.
View GitHub Profile
@Jswizzy
Jswizzy / InstallingSwift.md
Last active July 9, 2025 10:23
Swift Install Instruction 20.04

Installing Swift on Ubuntu 20.04

1. Install Depencies

“clang”[ˈklæŋ] is the compiler based on LLVM for C, C++, Objective-C, and Objective-C++. clang is needed to install in order to Swift. Run the following code in Ubuntu terminal.

Before installing swift “libpython2.7” and “libpython2.7-dev” are needed to get Swift running. Run the following code.

@c2d7fa
c2d7fa / 01-free-monad-state.ts
Last active March 5, 2024 06:27
Expressing a specific instance of the free monad in TypeScript
// https://underscore.io/blog/posts/2015/04/23/deriving-the-free-monad.html
// Example of implementing a specific instance of a free monad (for getting and
// setting an integer value) in TypeScript. The type system is not expressive
// enough to express free monads in general, but we can express a specific
// instance.
type AtomicOperation<T> = ["get", (x: number) => T] | ["set", number, T];
type Program<T> = ["return", T] | ["suspend", AtomicOperation<Program<T>>];
import {
useState,
useCallback,
useLayoutEffect,
useRef,
useEffect,
} from 'react';
const wait = () => new Promise((resolve) => setTimeout(resolve, 3000));
@edofic
edofic / index.html
Created May 6, 2023 19:06
htmx with a "backend" in service worker
<!DOCTYPE html>
<html>
<head>
<title>Hello Page</title>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<h1>Hello</h1>
@borispoehland
borispoehland / effects.ts
Last active May 7, 2024 09:48
3 fetch effects for effect-ts. One uses cache: no-store, one cache: force-cache and one uses the default cache / revalidate
import * as S from '@effect/schema/Schema'
import { Context, Effect } from 'effect'
export interface IFetcher {
fetch: typeof fetch
}
export const TFetcher = Context.Tag<IFetcher>('IFetcher')
class FreshFetcher implements IFetcher {
@kitlangton
kitlangton / kyo.scala
Last active March 19, 2024 23:55
Kyo (Alt. Encoding Explorations)
package zero
import izumi.reflect.Tag
import Kyo.*
import scala.collection.View.FlatMap
type Id[T] = T
type Const[T] = [U] =>> T
type MX[T] = Any