See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| import sys | |
| def j(lineno): | |
| frame = sys._getframe().f_back | |
| called_from = frame | |
| def hook(frame, event, arg): | |
| if event == 'line' and frame == called_from: | |
| try: | |
| frame.f_lineno = lineno |
See https://github.com/schmichael/nomad-tls for sample configs.
ssl instead of tls config parametersverify_ssl instead of verify_tlsconsul.cert_file should specify that it's the client certificate used for mutual authentication.consul.{ca,cert,key}_file should default to tls.{ca,cert,key}_fileThe gist: by having a Promise adopt the state of a forever pending one, you can suspend its then handlers chain.
Promise.pending = Promise.race.bind(Promise, [])
let cancel
new Promise(function(fulfill, reject) {
cancel = function() {fulfill(Promise.pending())}
setTimeout(fulfill, 1000, 5)| import React from 'react'; | |
| const MIN_SCALE = 1; | |
| const MAX_SCALE = 4; | |
| const SETTLE_RANGE = 0.001; | |
| const ADDITIONAL_LIMIT = 0.2; | |
| const DOUBLE_TAP_THRESHOLD = 300; | |
| const ANIMATION_SPEED = 0.04; | |
| const RESET_ANIMATION_SPEED = 0.08; | |
| const INITIAL_X = 0; |
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');| import * as React from 'react'; | |
| import { Component } from 'react'; | |
| export default function HOCBaseRender<Props, State, ComponentState>( | |
| Comp: new() => Component<Props & State, ComponentState>) { | |
| return class HOCBase extends Component<Props, State> { | |
| render() { | |
| return <Comp {...this.props} {...this.state}/>; | |
| } | |
| } |
| function logClass(target: any) { | |
| // save a reference to the original constructor | |
| var original = target; | |
| // a utility function to generate instances of a class | |
| function construct(constructor, args) { | |
| var c : any = function () { | |
| return constructor.apply(this, args); | |
| } |
Give developers more knowledge about how the classes behave in a non-relative sense: BEM + ITCSS = BEMIT
BEM: