Skip to content

Instantly share code, notes, and snippets.

View KeenS's full-sized avatar

κeen KeenS

View GitHub Profile
@KeenS
KeenS / DepTree.lean
Last active November 4, 2024 07:38
DepTree.lean
inductive Balance: Nat -> Nat -> Nat -> Type where
| lefty : Balance n.succ n.succ.succ n
| mid : Balance n n.succ n
| righty: Balance n n.succ.succ n.succ
inductive Tree (a: Type u): Nat -> Type u where
| leaf: Tree a 0
| node: Balance l n r -> Tree a l -> a -> Tree a r-> Tree a n
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gio
from gi.repository import GLib
conn = Gio.DBusProxy.new_for_bus_sync(
Gio.BusType.SESSION,
Gio.DBusProxyFlags.NONE,
# info
None,
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
module Either = struct
type ('a, 'b) t = Left of 'a | Right of 'b
let left v = Left v
let right v = Right v
let fold ~left ~right = function
| Left v -> left v
| Right v -> right v
end
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<title>Document</title>
</head>
<body>
<div class="controls">
<div class="left">
<div id="playButton" class="button">
fn extract_sqrt(mut n: u64) -> (u64, u64) {
let mut blocks = [0u8; 32];
let mut i = 0;
let mut ret = 0u64;
while n != 0 {
blocks[i] = (n & 0b11) as u8;
n >>= 2;
i += 1;
}
let mut q = 0;
//! rust port of this
//! https://twitter.com/gakuzzzz/status/1314499876969881602
//! requires nightly
// just for ease
#![feature(bool_to_option)]
// mandatory
#![feature(type_alias_impl_trait)]
// code
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
[package]
name = "so-actix-web-reqwest"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-web = "2.0"
reqwest = "0.10"
@KeenS
KeenS / qsort.smi
Last active January 3, 2020 16:35
An example of SML#'s MassiveThreads support
_require "basis.smi"
_require "thread.smi"