NOTE helper is optional - https://github.com/AlekSi/pointer
models.User{
ID: 1,
Login: "Jonh",
func UpgradeDB_BoringStyle(databaseURL string) error { | |
box, err := rice.FindBox("postgres") | |
if err != nil { | |
return errors.Wrap(err, "can not find db migrations") | |
} | |
sourceDriver, err := source.WithInstance(box) | |
if err != nil { | |
return errors.Wrap(err, "can not init source driver for db migrations") | |
} | |
m, err := migrate.NewWithSourceInstance("go.rice", sourceDriver, databaseURL) |
type StoreEventRequest struct { | |
EventID string `json:"event_id"` | |
ProjectID int `json:"-"` // TODO type? | |
Logger string `json:"logger"` | |
Platform string `json:"platform"` | |
Culprit string `json:"culprit"` | |
Extra map[string]interface{} `json:"extra"` | |
Release string `json:"release"` | |
Timestamp *time.Time `json:"timestamp"` | |
Fingerprint []string `json:"fingerprint"` |
NOTE helper is optional - https://github.com/AlekSi/pointer
models.User{
ID: 1,
Login: "Jonh",
Describe how to change various HTTP request attributes that usually differs from one request to another:
$ cat /etc/fstab | |
# | |
# /etc/fstab: static file system information | |
# | |
# <file system> <dir> <type> <options> <dump> <pass> | |
LABEL=EFI /boot vfat defaults,noatime,discard 0 1 | |
/dev/mapper/vgcrypt-root / ext4 defaults,noatime,discard 0 1 | |
/dev/mapper/vgcrypt-home /home ext4 defaults,noatime,discard 0 2 | |
# See https://wiki.archlinux.org/index.php/Mac#Yosemite_and_later |
package template | |
import ( | |
"io" | |
rice "github.com/GeertJohan/go.rice" | |
"github.com/flosch/pongo2" | |
"github.com/labstack/echo" | |
) |
Example of how terraform plan
looks like after one CIDR was changes in AWS Security Group
~ aws_security_group.sg-xxxxxxxx-de-team
ingress.2929851676.cidr_blocks.#: "6" => "0"
ingress.2929851676.cidr_blocks.0: "127.0.0.1/32" => "" <<< OLD CIDR
ingress.2929851676.cidr_blocks.1: "127.0.0.2/23" => ""
ingress.2929851676.cidr_blocks.2: "127.0.0.3/32" => ""
ingress.2929851676.cidr_blocks.3: "127.0.0.4/32" => ""
ingress.2929851676.cidr_blocks.4: "127.0.0.5/32" => ""
ingress.2929851676.cidr_blocks.5: "127.0.0.6/32" => ""
package main | |
import ( | |
"encoding/csv" | |
"log" | |
"strings" | |
"strconv" | |
"net/http" | |
"github.com/gosuri/uitable" | |
"fmt" |