This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| type MethodRequest int | |
| const ( | |
| Incr MethodRequest = iota | |
| Decr | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.stream.IntStream; | |
| public class SleepSort implements Runnable { | |
| private int number; | |
| private SleepSort(int number) { | |
| this.number = number; | |
| } | |
| public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const promisify = callback => (...args) => | |
| new Promise((resolve, reject) => | |
| callback(...args, (err, data) => err ? reject(err) : resolve(data)) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const dom = new Proxy({},{ | |
| get(target,property){ | |
| return function (attrs={},...children){ | |
| const el = document.createElement(property) | |
| for(let prop of Object.keys(attrs)){ | |
| el.setAttribute(prop,attrs[prop]) | |
| } | |
| console.log(property) // a li li li ul div | |
| for(let child of children){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function* fibonacci() { | |
| let [prev, curr] = [0, 1]; | |
| while (true) { | |
| [prev, curr] = [curr, prev + curr]; | |
| yield curr; | |
| } | |
| } | |
| for (let n of fibonacci()) { | |
| if (n > 1000) break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="loading"></div> |
NewerOlder