Skip to content

Instantly share code, notes, and snippets.

James u007

Block or report user

Report or block u007

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
u007 / action_signup.go
Last active Apr 14, 2017
go buffalo mailer
View action_signup.go
// actions/action_signup.go //in action handler file
import (
g "project/actions/shared"
// ""
// "fmt"
u007 / select2.js
Last active Apr 6, 2017
react and select2
View select2.js
//taming select2
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
var input = null
class SelectFieldComponent extends Component {
componentDidMount() {
u007 / application.js
Last active Oct 12, 2017
underscore, moment, jquery in webpack
View application.js
global._ = require('underscore')
window.$ = window.jQuery = require("jquery")
window.moment = require('moment')
u007 / StaticIframe.js
Last active Oct 19, 2017
react and iframe without rerendering
View StaticIframe.js
'use strict';
import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
var input, wrapper
class StaticIframeComponent extends Component {
constructor(props) {
u007 / Caddyfile
Last active Dec 4, 2018
Caddy vs traefik
View Caddyfile, {
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}
u007 / web
Last active Jul 9, 2018
logrotate configuration example
View web
# /etc/logrotate.d/web
# me = my username
# with max of 10MB
/home/me/web/log/production.log {
size 10M
create 0666 me
rotate 4
u007 / docker-compose.yml
Last active Aug 9, 2018
docker compose for web development
View docker-compose.yml
version: "3"
image: 'mariadb:10'
- "3306:3306"
- ./mariadb:/var/lib/mysql
u007 / slicepointer_reflect.go
Last active Oct 15, 2018
golang setting pointer slice with reflect
View slicepointer_reflect.go
package main
import (
type X struct {
Name string
Values *[]Y
u007 /
Last active Aug 7, 2019
DGraph Cheatsheet

DGraph Cheat sheet

How it works?

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"

u007 / docker-comose.yml
Created Nov 25, 2018
dgraph docker compose
View docker-comose.yml
version: "3.2"
image: dgraph/dgraph:v1.0.10
- "./dgraph0:/dgraph"
- 5080:5080
- 6080:6080
restart: on-failure
You can’t perform that action at this time.