This file contains 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 edn-linter | |
;; require name of edn linter | |
(:require [the-name :refer [parse-with-info]] | |
(def input-string "[:a :b | |
{:test 123}]") | |
(def parsed-edn (parse-with-info input-string)) | |
;; {:line 0 | |
;; :type :vector |
This file contains 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
;; From reddit comments | |
;; https://www.reddit.com/r/Clojure/comments/8lizcb/rclojure_fizz_buzz_contest_hardmode/ | |
$clear-stack | |
doc higher-fizzbuzz | |
"( map seq -- seq ) Returns modified seq with map target factors." | |
fn higher-fizzbuzz | |
*xs <> setl | |
*m <> setl |
This file contains 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
fn fizz-buzz | |
*n <> setl | |
n 3 mod zero? | |
n 5 mod zero? and if "FizzBuzz" else | |
n 3 mod zero? if "Fizz" else | |
n 5 mod zero? if "Buzz" else | |
n | |
then then then | |
endfn |
This file contains 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 website.fif-repl | |
(:require | |
[clojure.string :as str] | |
[rum.core :as rum] | |
[fif.core :as fif] | |
[fif.stack-machine :as stack] | |
[fif.stack-machine.error-handling :refer [set-error system-error]] | |
;; Nothing to see here | |
[website.repl-imports :refer [import-super-secret-words]])) |
This file contains 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 middleware) | |
(def default-response | |
{:status :init | |
:done false | |
:value nil}) | |
(def default-request |
This file contains 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 redditv.jsonp | |
(:require-macros [cljs.core.async.macros :refer [go]]) | |
(:require [cljs.core.async :refer [put! chan <! close!]]) | |
(:import [goog.net Jsonp] | |
[goog Uri])) | |
(defn send-jsonp [url] | |
(let [success-channel (chan) | |
error-channel (chan) | |
success-handler (fn [result] (if-not (nil? result) |
This file contains 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 'https://fonts.googleapis.com/css?family=Droid+Serif|Inconsolata'; | |
* { | |
font-family: 'Droid Serif', serif; | |
} | |
#content { | |
margin: 20px auto; | |
padding: 20px; | |
max-width: 800px; |
This file contains 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
(if (not (window-system)) | |
(progn | |
(package-require 'color-theme) | |
(color-theme-initialize) | |
(color-theme-tty-dark)) | |
(progn | |
(package-require 'waher-theme) | |
(load-theme 'waher t t))) |
This file contains 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
from types import ( | |
ListType, | |
TupleType, | |
FunctionType, | |
LambdaType | |
) | |
def thread_first(expr, *exprs): | |
for expression in exprs: | |
if type(expression) in [ListType, TupleType]: |
This file contains 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
(require 'iimage) | |
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t) | |
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t) | |
(add-to-list 'iimage-mode-image-regex-alist '("@startuml\s+\\(.+\\)" . 1)) | |
;; Rendering plantuml | |
(defun plantuml-render-buffer () | |
(interactive) | |
(message "PLANTUML Start rendering") | |
(shell-command (concat "java -jar ~/Downloads/plantuml.jar " |