Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096
(defn get-free-port [] | |
(with-open [socket (ServerSocket. 0)] | |
(.getLocalPort socket))) |
const pipeline = (...fns) => (val) => fns.reduce((prom, fn) => prom.then(fn), Promise.resolve(val)); | |
const myPipe = pipeline( | |
(val) => val + 1, | |
(val) => val + 1 | |
); | |
Promise.resolve(1) | |
.then(myPipe) | |
.then((result) => { |
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
(ns gumball-machine.core | |
(:require [thi.ng.color.core :as col] | |
[thi.ng.math.core :as m] | |
[thi.ng.geom.core :as g] | |
[thi.ng.geom.core.vector :refer [vec3]] | |
[thi.ng.geom.physics.core :as ph] | |
[thi.ng.geom.sphere :refer [sphere]] | |
[quil.core :as q :include-macros true])) | |
(def particles |
# These examples assume you have a container currently running. | |
# 1 Pipe from a file | |
sudo docker exec --interactive CONTAINER_NAME /bin/bash < the_beginning.sh | tee the_beginning_output.txt` | |
#2a Pipe by piping | |
echo "echo This is how we pipe to docker exec" | sudo docker exec --interactive CONTAINER_NAME /bin/bash - |
I recently watched Chris Houser's talk from Clojure/conj 2015 on condition systems in Clojure. I enjoyed the subject, so I decided to write up the talk as a way of encouraging me to really understand it, and in the hope that it might help others understand it.
The last time I heard about Common Lisp's condition system was at a talk by Didier Verna at ACCU in Bristol in 2013 (slides here). It sounded really interesting, but I didn't understand it well enough.
Chris Houser talks about different ways of handling errors in Clojure. Based on examples from Peter Seibel's book, Practical Common Lisp, he describes condition systems, which are also known as resumable exceptions, or restarts.
-- paste into http://elm-lang.org/try and click "compile" | |
-- http://imgur.com/gallery/W6TwgZw | |
import Graphics.Collage exposing (..) | |
import Graphics.Element exposing (..) | |
import Text | |
import Color exposing (..) | |
import Time | |
import Signal |
#!/usr/bin/env python | |
import pynvim, os, re, sys, time | |
# Get a list of buffers that haven't been deleted. `nvim.buffers` includes | |
# buffers that have had `:bdelete` called on them and aren't in the buffer | |
# list, so we have to filter those out. | |
def get_listed_buffers(nvim): | |
return set(buf.number for buf in nvim.buffers \ | |
if nvim.eval('buflisted(%d)' % buf.number)) |