See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| // TxFunc is a function that can be wrapped in a transaction | |
| type TxFunc func(tx *sql.Tx) error | |
| // WithTx wraps a function in an sql transaction. After the function returns, the transaction is | |
| // committed if there's no error, or rolled back if there is one. | |
| func WithTx(db *sql.DB, f TxFunc) (err error) { | |
| tx, err := db.Begin() | |
| if err != nil { | |
| return err | |
| } |
This list has moved to a GitHub repo for easier tracking: https://github.com/coreos/awesome-kubernetes-extensions
Please comment below if you are using Kubernetes Third-Party Resources and I will add you to the list.
Known Users:
| // Compile with: | |
| // GOOS=linux go build -a --ldflags '-extldflags "-static"' -tags netgo -installsuffix netgo -o dns-example main.go | |
| // | |
| // Run on Kubernetes. Example resolv.conf | |
| // | |
| // # /etc/reslov.conf | |
| // search default.svc.cluster.local svc.cluster.local cluster.local google.internal c.hightowerlabs.internal | |
| // nameserver 10.179.240.10 | |
| // options ndots:5 | |
| // |
title: PCDM Profile Template author:
Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.
My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important).
During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.
Here are main principles we use to write CSS for modern (IE11+) browsers:
| #!/bin/bash | |
| # This is free and unencumbered software released into the public domain. | |
| # | |
| # This script is designed to be run daily by cron. Please run it with randomness in its timing to | |
| # avoid load spikes at Let's Encrypt. One example, running between midnight at 2 AM, would be: | |
| # | |
| # 0 0 * * * sleep $[(RANDOM % 115)+5]m ; /usr/sbin/letsencrypt-renew.sh | |
| # | |
| # If you aren't using Nginx, adjust the startServer and stopServer methods to suit. Also, you could | |
| # use the webroot method. |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| package main | |
| // mentioned in bleve google group | |
| // https://groups.google.com/forum/#!topic/bleve/-5Q6W3oBizY | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "github.com/blevesearch/bleve" | |
| "github.com/blevesearch/bleve/document" |