I hereby claim:
- I am daveduthie on github.
- I am daveduthie (https://keybase.io/daveduthie) on keybase.
- I have a public key whose fingerprint is F9BA 7DBA 1883 7562 7626 9146 9312 1846 0BD0 1150
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
A beginner-friendly REPL that combines
| (function webpackUniversalModuleDefinition(root, factory) { | |
| if(typeof exports === 'object' && typeof module === 'object') | |
| module.exports = factory(require("react"), require("react-dom")); | |
| else if(typeof define === 'function' && define.amd) | |
| define(["react", "react-dom"], factory); | |
| else if(typeof exports === 'object') | |
| exports["ReactDataGrid"] = factory(require("react"), require("react-dom")); | |
| else | |
| root["ReactDataGrid"] = factory(root["React"], root["ReactDOM"]); | |
| })(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__) { |
| (ns lazy.partition) | |
| ;; returns tuple: [(take-while pred coll) rest-of-coll] | |
| (defn split-with [acc pred coll] | |
| (lazy-seq | |
| (let [h (first coll)] | |
| (if (and h (pred h)) | |
| (split-with (lazy-cat acc [h]) pred (rest coll)) | |
| [acc coll])))) |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
| (ns toe.core | |
| (:gen-class) | |
| (:require [clojure.string :as str])) | |
| ;; # Create board | |
| (defn new-board [size] | |
| (vec (repeat size (vec (repeat size :-))))) | |
| ;; # Draw board on screen | |
| (defn int->char [i] |
| ; Church Numerals in Clojure | |
| ; | |
| ; Church numerals use anonymous functions to represent numbers. | |
| ; | |
| ; ((zero f) x) -- returns x | |
| ; ((one f) x) -- return (f x) | |
| ; ((two f) x) -- return (f (f x)) | |
| ; ... | |
| (def zero (fn [f] (fn [x] x))) |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
| (ns schejule.core | |
| (:require [clojure.core.logic :as lg] | |
| [clojure.core.logic.pldb :as pldb])) | |
| ;; Declare database relations | |
| (pldb/db-rel tasko ^:index id) | |
| (pldb/db-rel precedo ^:index id other-id bool) | |
| ;; Make example db |
| ; Quick miniKanren-like code | |
| ; | |
| ; written at the meeting of a Functional Programming Group | |
| ; (Toukyou/Shibuya, Apr 29, 2006), as a quick illustration of logic | |
| ; programming. The code is really quite trivial and unsophisticated: | |
| ; it was written without any preparation whatsoever. The present file | |
| ; adds comments and makes minor adjustments. | |
| ; | |
| ; $Id: sokuza-kanren.scm,v 1.1 2006/05/10 23:12:41 oleg Exp oleg $ |