Skip to content

Instantly share code, notes, and snippets.

@koru1130
koru1130 / download.js
Last active January 8, 2023 19:54
NTU NOL crawler
import https from "https";
import fs from "fs";
import { readdir } from 'node:fs/promises';
import pMap from 'p-map'
const url = sem =>
pageNumber => `https://nol.ntu.edu.tw/nol/coursesearch/search_for_02_dpt.php?alltime=yes&allproced=yes&selcode=-1&dptname=0&coursename=&teachername=&current_sem=${sem}&yearcode=0&op=&startrec=${pageNumber*150}&week1=&week2=&week3=&week4=&week5=&week6=&proced0=&proced1=&proced2=&proced3=&proced4=&procedE=&proced5=&proced6=&proced7=&proced8=&proced9=&procedA=&procedB=&procedC=&procedD=&allsel=yes&selCode1=&selCode2=&selCode3=&page_cnt=150`
const getPage =
n => new Promise((resolve, reject) => {
@koru1130
koru1130 / fib_cps_defun.js
Last active August 2, 2020 08:24
Fibonacci |> CPS |> defunctionalization |> TCO |> defunctionalization
//const lam1_fun = (n, k) => x => fib_cps((n-2), lam2_fun(x, k))
const lam1_def = (n, k) => ({
tag: 'lam1',
n: n,
k: k
})
//const lam2_fun = (x, k) => y => k(x+y)
const lam2_def = (x, k) => ({
tag: 'lam2',
@koru1130
koru1130 / base64encode.hs
Created August 26, 2017 16:46
For Practice
{-# LANGUAGE ScopedTypeVariables #-}
module Main (main) where
import Data.List()
import Data.String()
import Data.List.Split
import Data.Function
import Data.Maybe
import System.Environment

Keybase proof

I hereby claim:

  • I am koru1130 on github.
  • I am koru1130 (https://keybase.io/koru1130) on keybase.
  • I have a public key ASBlmI3vlX-p2W9H-x5PBlPcElECQy2AWLO-3csvwdpZDgo

To claim this, I am signing this object: