Skip to content

Instantly share code, notes, and snippets.


Andrew Gwozdziewycz apg

View GitHub Profile
jpillora / sshd.go
Last active Apr 15, 2021
Go SSH server complete example - Read more here
View sshd.go
// A small SSH daemon providing bash sessions
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
// Client:
acolyer /
Last active Apr 14, 2021
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
read -p "Enter yubikey: " key
curl "$key"

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

View matching.el
;; (mcase subject-expr (pattern action) ...)
(defmacro mcase (subject &rest clauses)
`(funcall (mlambda ,@clauses) ,subject))
;; (mlambda (pattern action) ...)
(defmacro mlambda (&rest clauses)
(if (null clauses)
'(lambda (x) (match-error x))
(let ((subject (gensym)) (fail (gensym)))
`(lambda (,subject)
manuel / dyn-wind-commentary.scm
Created Aug 11, 2012
Commenting on Oleg's dyn-wind.scm
View dyn-wind-commentary.scm
;; See
;; and
;; Slight trick here: use identity of yield-record-tag function as the actual tag
(define (yield-record-tag) yield-record-tag)
(define (make-yield-record v k)
(list yield-record-tag v k))
;; Yield simply aborts up to the generator's caller, delivering to it
;; the yielded value and the continuation for resuming after the call
josephwecker /
Created Aug 11, 2012
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo:
# License: Public Domain.
# Author: Joseph Wecker, 2012
# This gist is slow and is missing .bashrc_once
# Use the one in the repo instead!
# (Thanks gioele)
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
jordanorelli / request.go
Created May 7, 2012
regex router in go.
View request.go
package core
import (
// the Request struct wraps the http.Request struct, providing a slice of
// strings representing the positional arguments found in a url pattern, and a
// map[string]string called kwargs representing the named parameters captured
// in url parsing.