Skip to content

Instantly share code, notes, and snippets.

View Lin-Ya's full-sized avatar
🏎️
GO~

HuiWing Lin-Ya

🏎️
GO~
View GitHub Profile
@Lin-Ya
Lin-Ya / index.js
Created August 11, 2023 03:02
simple queue
const makeQueue = () => {
let currentTask = Promise.resolve();
// create a new promise so that errors can be bubbled
// up to the caller without being caught by the queue
return (fn) =>
new Promise((resolve, reject) => {
currentTask = currentTask
.then(() => fn())
.then(resolve)
.catch(reject);
JSON 23 mins ██████████▉░░░░░░░░░░ 52.4%
Markdown 8 mins ████░░░░░░░░░░░░░░░░░ 19.6%
JavaScript 5 mins ██▋░░░░░░░░░░░░░░░░░░ 12.7%
Bash 3 mins █▍░░░░░░░░░░░░░░░░░░░ 6.7%
Other 1 min ▋░░░░░░░░░░░░░░░░░░░░ 3.4%
@Lin-Ya
Lin-Ya / File.java
Created January 18, 2019 03:34
Task 21
package com.orrz.unittest.model;
import java.io.*;
public class File {
private String path;
private BufferedReader reader;
private OutputStream out;
public File(String path) {