Skip to content

Instantly share code, notes, and snippets.

Kalman Speier speier

Block or report user

Report or block speier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View countdown.js
function countdown(start) {
return [...Array(start + 1).keys()].reverse()
speier / 1_app.js
Last active Oct 7, 2017
playing with hyperapp routing
View 1_app.js
import { app } from 'hyperapp';
import { router } from './router';
import routes from './routes';
import state from './state';
import actions from './actions';
const routable = router(routes);
app(routable)({ state, actions }).init(); // init is just an action, not related to routing
speier / getComments.js
Created Sep 22, 2017
get code comments
View getComments.js
const acorn = require('acorn');
const json5 = require('json5');
const getComments = (input) => {
const opts = {
onComment: []
try {
const ast = acorn.parse(input, opts);
View gist:0636271079b1f719353745b903c9013e
for i in *.pem; do echo -n "$i >>> "; openssl x509 -enddate -noout -in $i; done
View 10-base.conf
# /etc/systemd/system/docker.service.d/10-base.conf
ExecStart=/usr/bin/docker daemon \
-H fd:// \
-H tcp:// \
-H unix:///var/run/docker.sock \
--dns-search=service.consul \
View generate-pushid.js
* Fancy ID generator that creates 20-character string identifiers with the following properties:
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
View index.html
<script type="text/javascript" src=""></script>
<div class="mermaid">
graph LR;
C-->|build|P(Private Registry);
D-->|deploy|K(Kubernetes Master);

Keybase proof

I hereby claim:

  • I am speier on github.
  • I am speier ( on keybase.
  • I have a public key whose fingerprint is 0D74 6267 5850 AF29 09EA FD27 D938 278D 8250 3A95

To claim this, I am signing this object:

speier / clock.js
Created Oct 24, 2013
dead simple js clock (using moment.js)
View clock.js
function displayTime() {
var time = moment().format('HH:mm:ss');
setTimeout(displayTime, 1000);
$(document).ready(function() {
speier / pre-push.sample
Created Oct 8, 2013
git's default pre-push sample
View pre-push.sample
# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
# This hook is called with the following parameters:
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
You can’t perform that action at this time.