Dgraph is a graph databases. It stores data in a similar fashion for any type of collections. To differentiate the collection list, we may add a predicate, let's say "_type" indicate the type of collection / table. Example: User will have _type='users' and Role will have _type='roles'. ID field in dgraph is named "uid"
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
const auth: any = context.auth || {} | |
if (!auth || !auth.uid) { | |
//not logged in | |
} | |
let authUser = await admin.auth().getUser(auth.uid) |
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
exports = function(changeEvent) { | |
console.log("changed", changeEvent.operationType, JSON.stringify(Object.keys(changeEvent))) | |
//allows replace and create | |
if(changeEvent.operationType == "update") { | |
let keys = Object.keys(changeEvent.updateDescription.updatedFields) | |
console.log("changed", JSON.stringify(Object.keys(changeEvent.updateDescription.updatedFields))) | |
if(keys.indexOf('created_at') > -1 || keys.indexOf('updated_at') > -1 || keys.length == 0) { | |
//changed fields contains created_at or updated_at | |
// on $set, it will trigger "update" | |
console.log("ignoring change") |
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
module.exports = { | |
root: true, | |
env: { | |
browser: true, | |
node: true | |
}, | |
parser: 'vue-eslint-parser', | |
parserOptions: { | |
'parser': '@typescript-eslint/parser', | |
'ecmaVersion': 2017, |
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
version: "3.2" | |
services: | |
logrotate: | |
image: blacklabelops/logrotate | |
restart: unless-stopped | |
volumes: | |
- "/home/yourpathtolog:/log" | |
- "./logrotate-status:/logrotate-status" | |
environment: | |
- "LOGS_DIRECTORIES=/log" |
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
version: "3.2" | |
services: | |
dzero: | |
image: dgraph/dgraph:v1.0.10 | |
volumes: | |
- "./dgraph0:/dgraph" | |
ports: | |
- 5080:5080 | |
- 6080:6080 | |
restart: on-failure |
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" | |
"reflect" | |
) | |
type X struct { | |
Name string | |
Values *[]Y |
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
version: "3" | |
services: | |
mysql: | |
image: 'mariadb:10' | |
ports: | |
- "3306:3306" | |
volumes: | |
- ./mariadb:/var/lib/mysql | |
environment: | |
- "MYSQL_ROOT_PASSWORD=root" |
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
# /etc/logrotate.d/web | |
# me = my username | |
# with max of 10MB | |
/home/me/web/log/production.log { | |
size 10M | |
copytruncate | |
create 0666 me | |
compress | |
rotate 4 | |
missingok |
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
www.example.com:80, www.example.com:443 { | |
tls self_signed | |
log /logs access.log | |
errors visible | |
proxy /assets nginx:80 | |
proxy / web:3000 | |
redir 301 { | |
if {>X-Forwarded-Proto} is http | |
/ https://{host}{uri} |