This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/auth0/go-jwt-middleware" | |
"github.com/dgrijalva/jwt-go" | |
"gopkg.in/gin-gonic/gin.v1" | |
) | |
func main() { | |
startServer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Control.Monad.Identity | |
-- boostrap the conditions leading to 2 different implementations of the same business logic | |
main :: IO () | |
main = do | |
-- use a monad instance as 1st parameter in order to choose the implementation | |
expectedCalledWithMaybeInstance <- putStrLn $ getFirstName Nothing "heyhey" | |
expectedCalledWithIOInstance <- putStrLn $ getFirstName (Identity 0) "hoho" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
module Main where | |
import Control.Monad.Except | |
import Control.Monad.Reader | |
import Control.Monad.State | |
import Control.Monad.Writer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module Main where | |
import Control.Monad.Identity | |
data User = User | |
{ name :: String | |
, firstName :: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module Main where | |
import Control.Monad.Identity | |
import Control.Monad.Trans.Either | |
import Control.Monad.Trans.Except | |
data User = User |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
let mG = 1 | |
let s1G = 0.8 | |
let s2G = 0.6 | |
let s3G = 0.8 | |
let s1Striation = 50 | |
let s3Striation = 250 | |
let s1 = every 4 rev | |
$ every 2 (spread fast [2, 3, 1, 2] ) | |
$ every 3 (# speed 4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
let s1 = | |
sometimes (degradeBy 0.9) $ | |
sound "sn sn ~ ~ sn*3, ~ ~ sn*3/3 ~ ~" | |
let s2 = | |
rarely (jux (iter 4)) $ | |
sometimes rev $ | |
rarely (striate 3) $ | |
rarely (striate 40) $ | |
spread ($) [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type UnionFinder interface { | |
Union(p, r int) | |
Connected(p, r int) bool | |
} | |
// wqupc : Weighted Quick Union with Path Compression algorithm | |
type wqupc struct { | |
ids []int | |
w []int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type UnionFinder interface { | |
Union(p, r int) | |
Connected(p, r int) bool | |
} | |
// clean : Weighted Quick Union with Path Compression algorithm | |
type clean struct { | |
ids []int | |
weights []int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[global_config] | |
always_split_with_profile = True | |
borderless = True | |
focus = mouse | |
inactive_color_offset = 0.0 | |
title_font = Fira Code 9 | |
title_use_system_font = False | |
[keybindings] | |
close_term = <Super>w | |
go_down = <Super>j |
OlderNewer