Skip to content

Instantly share code, notes, and snippets.

View massoudasadi's full-sized avatar
🏠
Working from home

Massoud Asadi massoudasadi

🏠
Working from home
View GitHub Profile
@massoudasadi
massoudasadi / HomeWork.ts
Created November 21, 2022 21:01
HomeWork
// LTR
const pipe = (...fns: Function[]) => (x: any) => fns.reduce((res, fn) => fn(res), x);
// RTL
const compose = (...fns: Function[]) => (x: any) => fns.reduceRight((res, fn) => fn(res), x);
///////////////// Word Counter /////////////////////////////////////////////////////////
const text: string = " Hi, this is an Advanced !? 'text'\r\nAnother Line a \t b c a-a bc-d +.';";
@massoudasadi
massoudasadi / context.go
Created June 7, 2022 18:24 — forked from montanaflynn/context.go
An example of using context to cancel goroutines between server handlers
package main
import (
"context"
"fmt"
"log"
"net/http"
"sync"
"time"
)