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
| npm i -SE lodash ramda | |
| npm i -DE @types/lodash types/npm-ramda#dist |
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
| > Executing task: npm-run ts-node src/fizzbuzz.ts < | |
| Map { | |
| 1 => '1', | |
| 2 => '2', | |
| 3 => 'Fizz', | |
| 4 => '4', | |
| 5 => 'Buzz', | |
| 6 => 'Fizz', | |
| 7 => '7', |
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
| { | |
| "commands": [ | |
| { | |
| "command": "commands.refresh", | |
| "text": "$(sync)", | |
| "color": "#FFCC00" | |
| }, | |
| { | |
| "command": "workbench.action.tasks.runTask", | |
| "arguments": ["ts-node"], |
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
| class Fizz { | |
| public static spec: Array<[number, string]> = [[15, "FizzBuzz"], [5, "Buzz"], [3, "Fizz"]]; | |
| public static *buzz(size: number) { | |
| for (const i of Array(size).keys()) { | |
| const [_, result] = Fizz.spec.find(([n, s]) => i % n === 0) || [0, i.toString()]; | |
| yield result; | |
| } | |
| } | |
| } |
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
| Iterable<R> mapIndexed<T,R>(Iterable<T> list, R f(int index, T val)) sync*{ | |
| int i = 0; | |
| for(T val in list){ | |
| yield f(i++, val); | |
| } | |
| } |
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 time | |
| def worker(): | |
| print(time.time()) | |
| time.sleep(8) | |
| interval = 5 | |
| while True: | |
| worker() | |
| time.sleep(interval) |
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
| (conj list2 10) | |
| (concat list1 list2) |
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" | |
| "syscall" | |
| "unsafe" | |
| "github.com/AllenDang/w32" | |
| ) |
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" | |
| "syscall" | |
| "unsafe" | |
| "github.com/AllenDang/w32" | |
| ) |
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" | |
| "syscall" | |
| "time" | |
| "github.com/AllenDang/w32" | |
| ) |