OpenStack has a set of style guidelines for clarity. OpenStack is a very large code base (over 1 Million lines of python), spanning dozens of git trees, with over a thousand developers contributing every 12 months. As such common style helps developers understand code in reviews, move between projects smoothly, and overall make the code more maintainable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/rand" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just some stuff you might like to read / watch on the plane if you are interested. | |
OP-ED: | |
http://www.evanmiller.org/four-days-of-go.html | |
Video: | |
https://youtu.be/elu0VpLzJL8 -- Go for pythonista's -- 51m | |
https://youtu.be/woCg2zaIVzQ -- Concurrency + Composition -- 14m | |
https://youtu.be/B-r3Wf_I2Lk -- General stuff -- 18m | |
https://www.youtube.com/playlist?list=PLMW8Xq7bXrG58Qk-9QSy2HRh2WVeIrs7e -- Others |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> | |
<script> | |
var createPasswordToggle = function(toggleTriggerId, passwordId) { | |
var changeInput = function(old, newType) { | |
// http://stackoverflow.com/a/9094151 | |
var n = document.createElement('input'); | |
n.type = newType; | |
if(old.size) n.size = old.size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function preventBackspace() { | |
function matchesSelector_(el, selector) { | |
return (el.matches || el.msMatchesSelector).call(el, selector); | |
} | |
function prevent(e) { | |
if (e.which === 8) { // Backspace | |
if (!matchesSelector_(e.target, 'input:not([readonly]):not([type=radio]):not([type=checkbox]), textarea, [contentEditable], [contentEditable=true]')) { | |
e.preventDefault(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +danielwakefield is my blockchain ID. https://onename.com/danielwakefield |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Provide string-matching based on fnmatch.3 | |
package fnmatch | |
// There are a few issues that I believe to be bugs, but this implementation is | |
// based as closely as possible on BSD fnmatch. These bugs are present in the | |
// source of BSD fnmatch, and so are replicated here. The issues are as follows: | |
// | |
// * FNM_PERIOD is no longer observed after the first * in a pattern | |
// This only applies to matches done with FNM_PATHNAME as well | |
// * FNM_PERIOD doesn't apply to ranges. According to the documentation, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-ed25519-cert-v01@openssh.com AAAAIHNzaC1lZDI1NTE5LWNlcnQtdjAxQG9wZW5zc2guY29tAAAAILfZFL+Sc2QwVYljr+679F2u7l3dCt1W+yHpwKtfk31XAAAAIMWYZwqrMlekLqZnjCq5HA4OPuvRKMtBE7AAuB54McXBAAAAAAAAAAAAAAABAAAAIVNpZ25lZCBrZXkgZm9yIEdDIC0gRXhwOiBNYXIgMjAxOAAAAAgAAAAEYWRteAAAAABY1s8gAAAAAFqXQoAAAAAAAAAAggAAABVwZXJtaXQtWDExLWZvcndhcmRpbmcAAAAAAAAAF3Blcm1pdC1hZ2VudC1mb3J3YXJkaW5nAAAAAAAAABZwZXJtaXQtcG9ydC1mb3J3YXJkaW5nAAAAAAAAAApwZXJtaXQtcHR5AAAAAAAAAA5wZXJtaXQtdXNlci1yYwAAAAAAAAAAAAABFwAAAAdzc2gtcnNhAAAAAwEAAQAAAQEAtUbVYENqorKEn5Q78AqqLR90+T5zIA+NVz7jxuAO8/7eipF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