Skip to content

Instantly share code, notes, and snippets.

View calam1's full-sized avatar

Christopher Lam calam1

View GitHub Profile
@rcook
rcook / LICENSE
Last active March 28, 2021 17:38
Traits and polymorphism in Rust
The MIT License (MIT)
Copyright (c) 2020 Richard Cook
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@montanaflynn
montanaflynn / main.go
Last active May 28, 2024 04:32
Gin request timeout middleware and handler
package main
import (
"context"
"log"
"net/http"
"time"
"github.com/gin-gonic/gin"
)
@dypsilon
dypsilon / reader.js
Last active April 28, 2024 08:50
Example usage of the reader monad.
/**
* This short program will encrypt the user password
* and insert a new record into a mock database.
*/
const Reader = require('fantasy-readers');
const R = require('ramda');
const crypto = require('crypto');
// our mock database
const database = [