CREATE TEMP TABLE prod_comps (
prod_id VARCHAR(20),
comp_id VARCHAR(20)
);
INSERT INTO prod_comps (prod_id, comp_id) VALUES ('Prod', 'B');
INSERT INTO prod_comps (prod_id, comp_id) VALUES ('Prod', 'C');
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
// mutable references are move | |
// unmutable references are copy |
psql (9.6.1, server 9.5.10)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.
auth_svc=> select id, deleted_at from users order by id desc limit 2;
id | deleted_at
---------+------------
1910482 |
1910481 |
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 ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"net/http" | |
"strings" | |
"github.com/gorilla/mux" |
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 ( | |
"fmt" | |
"time" | |
"github.com/dgrijalva/jwt-go" | |
) | |
const secret = "big-secret" |
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 ( | |
"fmt" | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/postgres" | |
) | |
type Manufacturer struct { | |
gorm.Model |
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
position_train = 0 | |
def train_leaving_station(station, train) | |
return if station.empty? | |
if station.last == train[position_train] | |
station.pop | |
position_train++ | |
train_leaving_station(station, train) |
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
# covermodes: set, atomic, count | |
go test -coverprofile="coverage.out" -covermode count | |
# coverage by function | |
go tool cover --func="coverage.out" | |
# HTML | |
go tool cover -html=coverage.out -o coverage.html |
NewerOlder