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
// Usage:- https://replit.com/@Vikasg7/repeatLatestOnInterval | |
// Clojure version:- https://github.com/Vikasg7/clj-snake/blob/main/src/clj_snake/utils.clj | |
const repeatLatestOnInterval = (delayInMS) => (source) => | |
new Observable((observer) => { | |
let id = null | |
const next = (value) => { | |
observer.next(value) // sending downstream | |
clearTimeout(id) | |
id = setTimeout(next, delayInMS, value) |
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
(ns cola.core) | |
(def names ["Sheldon" "Leonard" "Penny" "Rajesh" "Howard"]) | |
(defn double-size [[size name]] | |
[(* 2 size) name]) | |
(def group (map vector (repeat 1) names)) | |
(def groups (lazy-cat group (map double-size groups))) |
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 ReadTextFile(ByVal fPath As String) | |
' A reference to "Microsoft Scripting Runtime library" has to be made before using FileSystemObject. | |
Dim FSobj As New FileSystemObject | |
Dim textfile As TextStream | |
Set textfile = FSobj.GetFile(fPath).OpenAsTextStream(1, -2) | |
ReadTextFile = textfile.ReadAll | |
textfile.Close |