Skip to content

Instantly share code, notes, and snippets.

View magic-akari's full-sized avatar
🦀

magic-akari

🦀
View GitHub Profile
@magic-akari
magic-akari / .gitignore
Last active July 30, 2022 02:44
jest_workaround example
node_modules
.swc
output
const promisePool = <T>(list: Iterable<() => PromiseLike<T>>, limit: number): Promise<T[]> => {
const result: Promise<T>[] = [];
const iterator = list[Symbol.iterator]();
return new Promise((resolve, reject) => {
const settle = (next: ReturnType<typeof iterator["next"]>) => {
if (next.done) {
Promise.all(result).then(resolve, reject);
return;
@magic-akari
magic-akari / README.md
Last active March 2, 2019 04:19
EDGE IMPORT TEST

This is a test demo for Edge. You may need a static file server to view the demo page.

Lit-element test

This file is used to be tracked and identified by https://lrc-maker.github.io
@magic-akari
magic-akari / .gitignore
Created December 9, 2018 01:27
tsc bug demo 2
node_modules
dist
@magic-akari
magic-akari / app.tsx
Last active December 7, 2018 16:19
tsc bug demo
export class App extends React.Component {
readonly state = { clicked: 0 };
onClick = () => this.setState({ clicked: this.state.clicked + 1 });
public render() {
return (
<div>
<div>You have clicked {this.state.clicked}</div>
<button onClick={this.onClick}>click me</button>
@magic-akari
magic-akari / ConvertToHEIC.js
Last active September 12, 2019 13:21 — forked from sinoru/ConvertToHEIC.swift
ConvertToHEIC
#!/usr/bin/env osascript -l JavaScript
ObjC.import("Foundation");
ObjC.import("ImageIO");
ObjC.import("AVFoundation");
const quality = 0.8;
function run(input) {
for (const file of input) {