Skip to content

Instantly share code, notes, and snippets.

View binq's full-sized avatar

Vanson Samuel binq

View GitHub Profile
@binq
binq / Main.hs
Created November 19, 2021 18:21
both :: Maybe a -> Maybe a -> Bool
both (Just _) (Just _) = True
both _ _ = False
f n =
let
f = bool Nothing (Just Fizz) (n % 3 == 0)
b = bool Nothing (Just Buzz) (n % 5 == 0)
u = bool Nothing (Just FizzBuzz) (all isJust [f, b])
g = bool Nothing (Just (Got n)) (all isNone [f, b])
@binq
binq / temp.go
Last active March 26, 2019 00:47
package main
import (
"fmt"
"math/rand"
"sync"
"sync/atomic"
"time"
)
@binq
binq / temp.hs
Last active January 27, 2019 22:01
type family DownLevel (a' :: (a :: Type)) :: (b :: Type) where
DownLevel x = x
appendHallway1 ::
forall t ds (ds' :: t) dsl (dsl' :: [t]).
(t ~ DoorState, ds ~ DownLevel ds', dsl ~ DownLevel dsl') =>
Door ds ->
Hallway dsl ->
Hallway (ds : dsl)
appendHallway1 d rest = Section d rest
$$(".extension").map(function (x) {
const
getName = function () {
const
maybeName = x.querySelector(".descname"),
name = null == maybeName ? "no name" : maybeName.innerText;
return name;
},
getDek = function () {
@binq
binq / temp.hs
Last active October 8, 2018 16:34
#!/usr/bin/env stack
-- stack --resolver=lts-12.9 script
{-#LANGUAGE
ConstraintKinds,
FlexibleContexts,
GADTs,
LambdaCase,
KindSignatures,
MultiWayIf,
{-# LANGUAGE ExplicitNamespaces, GADTs, KindSignatures, Safe, StrictData #-}
module FizzBuzz where
import Control.Arrow
import Data.Kind (type (*))
data ZZ :: * -> * where
Base :: a -> ZZ a
Fizz :: ZZ a

Keybase proof

I hereby claim:

  • I am binq on github.
  • I am binq (https://keybase.io/binq) on keybase.
  • I have a public key whose fingerprint is 9934 562E CE00 CF8D BEBF 48B5 A842 06C4 439E 6EA5

To claim this, I am signing this object:

{"apiVersion":"0.1","swaggerVersion":"1.2","produces":["application/json"],"apis":[{"path":"/rules.{format}","description":"Operations about rules"},{"path":"/swagger_doc.{format}","description":"Operations about swagger_docs"}],"info":{}}
#!/usr/bin/env bash
# echo COMMAND: ${COMMAND:?"Need to set COMMAND non-empty"}
# echo NODD: ${NODD:?"Need to set NODD non-empty"}
# echo NEVEN: ${NEVEN:?"Need to set NEVEN non-empty"}
BASE="/Users/vansonsamuel/Vagrant"
HOME="/Users/vansonsamuel/Vagrant/centos-6.5"
function destroy {