- Quil Graphics and animation sketches, based on Processing
- th.ing/geom a comprehensive and modular geometry & visualization toolkit. WebGL, OpenGL, SVG.
- Iglu Turning data into GLSL shaders for use by OpenGL and WebGL. By Zach Oakes, part of play-cljc.
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
# Handling CORS headers for handling cross-origin requests example | |
# See https://developer.mozilla.org/en/docs/Web/HTTP/CORS | |
# TODO: check if origin is set. If missing then do not add CORS headers | |
# TODO: handle ports in origin | |
# check if origin header is among allowed ones | |
map $http_origin $cors_origin { | |
hostnames; | |
# all domains and subdomains for my-site.com or *.my-site.com can request contents |
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 '[clojure.core.specs.alpha]) | |
(require '[clojure.spec.alpha :as s]) | |
(require '[clojure.spec.test.alpha :as stest]) | |
(require '[expound.alpha :as expound]) | |
(set! s/*explain-out* (expound/custom-printer {:print-specs? false})) ; The "relevant specs" are very long, so let's omit them | |
(stest/instrument) | |
(let [foo/bar 42]) | |
;; CompilerException clojure.lang.ExceptionInfo: Call to clojure.core/let did not conform to spec: |
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
;; clojure.spec's missing piece, work in progress | |
;; this is only halfway done, somebody else will need to do the other 95% | |
(require | |
'[clojure.spec :as s] | |
'[clojure.spec.test :as test]) | |
(defn naive-english-explain | |
"Copy and paste this into your app. Figure out what it does by | |
trying it in production." |
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 sunshine.disk-read | |
(:require [clojure.core.async :as async :refer [>! <! go-loop chan close! <!!]]]) | |
(:import (java.io BufferedReader FileReader FileInputStream BufferedInputStream InputStreamReader))) | |
(def ten-gb-filename "ten.json") | |
(def one-meg (* 1024 1024)) | |
(defn ^FileInputStream input-stream [^String fname] | |
(FileInputStream. fname)) |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
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 cognician.db.translate | |
(:require [datomic.api :as d]) | |
(:import [clojure.lang MapEntry] | |
[datomic.query EntityMap])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Language | |
(def default-language :en-GB) |
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 'clj-slack.users) | |
(require 'clj-slack.channels) | |
(def connection {:api-url "https://slack.com/api" :token "TOKEN"}) | |
;; Get all the users and channels | |
(def users (clj-slack.users/list connection)) | |
(def channels (clj-slack.channels/list connection)) | |
;; Find the channel we care about |
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
global | |
log /dev/log local0 | |
log /dev/log local1 notice | |
chroot /var/lib/haproxy | |
stats socket /run/haproxy/admin.sock mode 660 level admin | |
stats timeout 30s | |
user haproxy | |
group haproxy | |
daemon | |
maxconn 2048 |
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
@next_upgrade ||= false | |
source 'https://rubygems.org' | |
if @next_upgrade | |
gem 'rails', '6.0.0.rc2' | |
else | |
gem 'rails', '~> 5.2.0' | |
end | |
# rest of gems below .... |
NewerOlder