- lxc/libcontainer/ :: execution
- namespaces :: isolation
- cgroups :: sharing
- unionfs :: layering
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
. |
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
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"strings" | |
"time" | |
) | |
// https://httpd.apache.org/docs/2.2/logs.html#combined + execution time. | |
const apacheFormatPattern = "%s - - [%s] \"%s %s %s\" %d %d \"%s\" \"%s\" %.4f\n" |
There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.
All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.
- Loop variables are scoped outside the loop.
What do these lines do? Make predictions and then scroll down.
func print(pi *int) { fmt.Println(*pi) }
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
# Original Rails controller and action | |
class EmployeesController < ApplicationController | |
def create | |
@employee = Employee.new(employee_params) | |
if @employee.save | |
redirect_to @employee, notice: "Employee #{@employee.name} created" | |
else | |
render :new | |
end |
Command Line
pry -r ./config/app_init_file.rb
- load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb
- load your rails into a pry session
Debugger
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
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 ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"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
# Make the blue color for directories more readable | |
set -x LSCOLORS Exfxcxdxbxegedabagacad | |
# this is needed to avoid strange python stack backtrace complaining about UTF-8 when | |
# running sphinx. Found it by googling | |
set -x LC_ALL en_US.UTF-8 | |
set -x LANG en_US.UTF-8 | |
set -x JULIA_EDITOR textmate | |
# so our brew install override the commands from the system |
Instantly better presentations - Damian Conway
It probably just makes more sense to just view his version online at:
http://damian.conway.org/IBP.pdf
But making notes is useful anyway.