(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| type BusyBuilder(blockUi, unblockUi) = | |
| member this.Bind(x, f) = async.Bind(x, f) | |
| member this.Combine(e1, e2) = async.Combine(e1, e2) | |
| member this.Delay(f) = | |
| async { | |
| blockUi () | |
| let! result = async.Delay f | |
| unblockUi () | |
| return result | |
| } |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| (defn flip [function] | |
| (fn | |
| ([] (function)) | |
| ([x] (function x)) | |
| ([x y] (function y x)) | |
| ([x y z] (function z y x)) | |
| ([a b c d] (function d c b a)) | |
| ([a b c d & rest] | |
| (->> rest | |
| (concat [a b c d]) |
| /* LightTable themes are just CSS. LightTable, CodeMirror, and plugins apply | |
| classes to tokens within the text. Most of these classes are undocumented. I | |
| had to go fishing with the dev inspector and apply brightly colored rules to | |
| figure it out. Hopefully I can save you the trouble by documenting the default | |
| theme. Please comment if you find any errors or omissions. */ | |
| /* These #multi rules apply to tabsets. Active means currently selected and dirty | |
| means that the file has been edited since the last save. */ | |
| #multi.theme-default .tabset .list .active { color:var(placeholder-fg); } | |
| #multi.theme-default .tabset.active .list .active { color:var(highlight-fg); } |
| (ns ^{ :doc "Base64 Encoding/Decoding in Clojure" | |
| :author "Yannick Scherer" } | |
| base64) | |
| ;; ## Conversion Functions | |
| (def ^:private base64-chars | |
| "Base64 Characters in the right order." | |
| (vec | |
| (concat |
| #!/usr/bin/env bash | |
| # Runs a command wrapped in btrfs snapper pre-post snapshots. | |
| # Usage: $ snp <commands> | |
| # e.g.: $ snp pacman -Syyu | |
| # Requirements: snapper (https://wiki.archlinux.org/title/snapper) | |
| # The latest version of this script is hosted at https://gist.github.com/erikw/5229436 | |
| log_path="/var/local/log/snp" | |
| date=$(date "+%Y-%m-%d-%H%M%S") | |
| log_file="${log_path}/snp_${date}.log" |
| ;; | |
| ;; NS CHEATSHEET | |
| ;; | |
| ;; * :require makes functions available with a namespace prefix | |
| ;; and optionally can refer functions to the current ns. | |
| ;; | |
| ;; * :import refers Java classes to the current namespace. | |
| ;; | |
| ;; * :refer-clojure affects availability of built-in (clojure.core) | |
| ;; functions. |