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
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
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
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon \
-H fd:// \
-H tcp://0.0.0.0:2376 \
-H unix:///var/run/docker.sock \
--dns-search=service.consul \
--dns=10.135.27.153
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="http://www.sveido.com/mermaid/dist/mermaid.full.min.js"></script>
<div class="mermaid">
graph LR;
D(Developer)-->|push|GH(GitHub);
GH-->|test|C(CircleCI);
C-->|build|P(Private Registry);
P---|store|G(GCS);
D-->|deploy|K(Kubernetes Master);
P---K;
View keybase.md

Keybase proof

I hereby claim:

  • I am speier on github.
  • I am speier (https://keybase.io/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
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');
$('#clock').html(time);
setTimeout(displayTime, 1000);
}
$(document).ready(function() {
displayTime();
});
@speier
speier / pre-push.sample
Created Oct 8, 2013
git's default pre-push sample
View pre-push.sample
#!/bin/sh
# 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.