Skip to content

Instantly share code, notes, and snippets.

View ronenlh's full-sized avatar

Ronen Lahat ronenlh

View GitHub Profile
@ronenlh
ronenlh / app_.gitignore
Created January 11, 2016 10:56
A small game I made while I learn some methods in Android.
/build
Verifying my Blockstack ID is secured with the address 1H7aav5MLqnEpPd5JGaLwFv4VdyaFxttFz https://explorer.blockstack.org/address/1H7aav5MLqnEpPd5JGaLwFv4VdyaFxttFz
@ronenlh
ronenlh / uv_run.c
Created June 20, 2021 08:42
node's libuv core
int uv_run(uv_loop_t* loop, uv_run_mode mode) {
int timeout;
int r;
int ran_pending;
r = uv__loop_alive(loop);
if (!r)
uv__update_time(loop);
while (r != 0 && loop->stop_flag == 0) {
{ lib
, stdenv
, fetchurl
, testVersion
, hello
}:
stdenv.mkDerivation rec {
pname = "hello";
version = "2.10";
@ronenlh
ronenlh / shell.nix
Last active October 11, 2021 09:49
{ }:
let
pkgs = import (builtins.fetchGit {
name = "nixpkgs-with-cmake-3.18.2";
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/heads/nixpkgs-unstable";
rev = "2c162d49cd5b979eb66ff1653aecaeaa01690fcc";
}) {};
pkgs_ninja = import (builtins.fetchGit {
// TypeScript
// Types
type Coin = { readonly tag: "Coin" };
type HotWater = { readonly tag: "HotWater" };
type Noodles = { readonly tag: "Noodles" };
type InstantNoodles = (hw: HotWater) => Noodles;
// Theorem: Given an instant noodle vending machine I can make a coin-&-hot-water-to-noodles system
function theorem(vendingMachine: (coin: Coin) => InstantNoodles): (assets: { coin: Coin; hotWater: HotWater }) => Noodles {
// TypeScript
// Types
type P = { readonly tag: "P" };
type Q = { readonly tag: "Q" };
type R = { readonly tag: "R" };
type Theorem = (h: (p: P) => (q: Q) => R) => ((hpq: { left: P; right: Q }) => R);
// Theorem
// TypeScript Type
(h: (p: P) => (q: Q) => R) => ((hpq: { left: P; right: Q }) => R)
// Logic theorem
(P → Q → R) → (P ∧ Q → R)
-- Lean
example : (P → Q → R) → (P ∧ Q → R) :=
fun myFunc myParam =>
myFunc myParam.left myParam.right