Skip to content

Instantly share code, notes, and snippets.

View simon300000's full-sized avatar

Simon simon300000

View GitHub Profile
Scala 1 hr 32 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‰โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 42.8%
TypeScript 51 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–‰โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 23.6%
JavaScript 37 mins โ–ˆโ–ˆโ–ˆโ–Œโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 17.2%
Other 22 mins โ–ˆโ–ˆโ–โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 10.4%
JSON 8 mins โ–Šโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ 4.0%
@simon300000
simon300000 / factorial.js
Last active September 18, 2019 22:40
wow Y combinator.js?
// Simple
const simpleRecursive = () => simpleRecursive()
simpleRecursive()
// "simpleRecursive" is undefined! (static check)
const notSoSimpleRecursive = me => me(me)
notSoSimpleRecursive(notSoSimpleRecursive)
// Don't run forever!
const factorial = (me, n) => n < 1 ? 1 : n * me(me, n - 1)
@simon300000
simon300000 / worker.js
Created September 14, 2019 00:41
make function a WebWorker
// ๅˆšๅˆš่ฏด็š„ๆ„Ÿ่ง‰ๅพˆๆœ‰ๆ„ๆ€
// ๆˆ‘ๅšไบ†ไธชDemo2333
// ไธ่ฟ‡ๅช่ƒฝๅผ„ๅพˆ็ฎ€ๅ•็š„Function๏ผˆ ๅฏ่งFunctionalๆ˜ฏๆœชๆฅ๏ผˆ ่ฏฏ๏ผ‰
const testFunction = num => num * 2
const slowFunction = time => {
const now = Date.now()
let round = 0
while (now + time > Date.now()) {
round++
@simon300000
simon300000 / kkomda.jpg
Last active August 11, 2023 02:12
โ†’_โ†’
kkomda.jpg