Skip to content

Instantly share code, notes, and snippets.

(define-module (async)
#:export (make-channel
ch-write
ch-read
fiber))
(use-modules (ice-9 match)
(ice-9 atomic)
(ice-9 q)
(ice-9 threads)
@faust45
faust45 / btree.hs
Created July 5, 2022 20:57 — forked from yamaguchiyuto/btree.hs
Haskell B-tree implementation
data Tree a = Nil Int | Leaf Int [a] | Node Int [a] [Tree a] deriving Show
find :: (Ord a, Eq a) => Tree a -> a -> Bool
find (Nil _) _ = False
find (Leaf _ []) _ = False
find (Leaf m (k:ks)) x
| x == k = True
| x < k = False
| x > k = find (Leaf m ks) x
find (Node _ [] (t:ts)) x = find t x
module PushNotifications
class Enqueuer
attr_accessor :user
def initialize(u)
@user = u
end
def enqueue(payload)
token = User::DeviceToken.where(user_id: user.id, token_type: 'ios').last
@faust45
faust45 / main.dart
Last active January 24, 2021 10:10
import 'package:flutter/material.dart';
import 'menu/app_drawer.dart';
import 'state.dart';
import 'package:get/get.dart';
void main() {
runApp(MyApp());
}
class AState {
(ns app
(:require [clojure.string :refer [replace]]))
(def s1 "[[][{]]")
(def s2 "[[]][][{]}[]")
(def s3 "[[{}][]]")
(ns app
(:require [clojure.string :refer [replace]]))
(def s1 "[[][{]]")
(def s2 "[[]][][{]}[]")
(def s3 "[[{}][]]")
(ns app
(:require [clojure.string :refer [replace]]))
(def s1 "[[][{]]")
(def s2 "[[]][][{]}[]")
(def s3 "[[{}][]]")
(ns app
(:require [clojure.string :refer [replace]]))
(def s1 "[[][{]]")
(def s2 "[[]][][{]}[]")
(def s3 "[[{}][]]")
#lang racket/load
(define (add-rat x y)
(make-rat (+ (* (numer x) (denom y))
(* (numer y) (denom x)))
(* (denom x) (denom y))))
(define (sub-rat x y)
(make-rat (- (* (numer x) (denom y))
(* (numer y) (denom x)))
#lang racket/load
(define (add-rat x y)
(make-rat (+ (* (numer x) (denom y))
(* (numer y) (denom x)))
(* (denom x) (denom y))))
(define (sub-rat x y)
(make-rat (- (* (numer x) (denom y))
(* (numer y) (denom x)))