# Query
mutation {
update_product(
where: {
uuid: {_eq: "09cf633b-a34c-45cc-ad59-3273e3ad65f3"}
},
_delete_key: {
spec: "driver_units"
}# Query
mutation updateProductSpec ($data: jsonb) {
update_product(
where: {
uuid: {_eq: "09cf633b-a34c-45cc-ad59-3273e3ad65f3"}
},
_append: { spec: $data }
) {
affected_rows# Query
mutation updateProductSpec ($data: jsonb) {
update_product(
where: {
uuid: {_eq: "09cf633b-a34c-45cc-ad59-3273e3ad65f3"}
},
_append: { spec: $data }
) {
affected_rows# Query
mutation insertProduct($spec: jsonb) {
insert_product(objects:[{
name: "Skullcandy Ink'd Headset with mic",
category: "Earphones",
description: "Invest in these Skullcandy Ink'd earphones and enjoy listening to music in a high-quality audio reproduction. It comes with Supreme Sound technology that ensures deep and powerful bass to take your music to a new level",
price: 799,
spec: $spec
}]) {
This file contains hidden or 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
| CREATE TABLE product ( | |
| uuid UUID NOT NULL DEFAULT gen_random_uuid(), | |
| name TEXT NOT NULL, | |
| category TEXT NOT NULL, | |
| description TEXT NOT NULL, | |
| price NUMERIC NOT NULL, | |
| spec JSONB NOT NULL, | |
| PRIMARY KEY (uuid) | |
| ); |
This file contains hidden or 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
| # Delete all docker images from the machine | |
| docker system prune --all |
This file contains hidden or 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
| #!/usr/bin/python | |
| import socket | |
| import time | |
| count = 0 | |
| holdSockets = [] | |
| from random import choice | |
| from string import ascii_lowercase |
This file contains hidden or 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
| kube_prompt() | |
| { | |
| kubectl_current_context=$(kubectl config current-context) | |
| kubectl_prompt="( \u2388 $kubectl_current_context )" | |
| echo $kubectl_prompt | |
| } | |
| RPROMPT='%F{81}$(kube_prompt)' |
This file contains hidden or 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
| FROM golang:1.8.5-jessie as builder | |
| # install xz | |
| RUN apt-get update && apt-get install -y \ | |
| xz-utils \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # install UPX | |
| ADD https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz /usr/local | |
| RUN xz -d -c /usr/local/upx-3.94-amd64_linux.tar.xz | \ | |
| tar -xOf - upx-3.94-amd64_linux/upx > /bin/upx && \ | |
| chmod a+x /bin/upx |
This file contains hidden or 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
| FROM golang:1.8.5-jessie | |
| # install dep | |
| RUN go get github.com/golang/dep/cmd/dep | |
| # create a working directory | |
| WORKDIR /go/src/app | |
| # add Gopkg.toml and Gopkg.lock | |
| ADD Gopkg.toml Gopkg.toml | |
| ADD Gopkg.lock Gopkg.lock | |
| # install packages | |
| # --vendor-only is used to restrict dep from scanning source code |