Skip to content

Instantly share code, notes, and snippets.

View danielmai's full-sized avatar

Daniel Mai danielmai

  • San Francisco, CA
View GitHub Profile
@danielmai
danielmai / _README.md
Last active May 28, 2021 19:08 — forked from mjpitz/_README.md
dgraph troubles
@danielmai
danielmai / README.md
Last active September 14, 2022 08:53
Dgraph + Nginx Load Balancing

Download this gist's ZIP file and extract it to a directory called dgraph-nginx.

mkdir dgraph-nginx
cd dgraph-nginx
wget -O dgraph-nginx.zip https://gist.github.com/danielmai/0cf7647b27c7626ad8944c4245a9981e/archive/5a2f1a49ca2f77bc39981749e4783e3443eb3ad9.zip
unzip -j dgraph-nginx.zip

This creates two files: docker-compose.yml and nginx.conf.

@danielmai
danielmai / docker-compose.yml
Last active September 6, 2019 01:21
Docker Compose to run Dgraph, bind-mounting data directories to $HOME/dgraph
version: "3.2"
services:
zero:
image: dgraph/dgraph:latest
volumes:
- type: bind
source: $HOME/dgraph
target: /dgraph
ports:
- 5080:5080
@danielmai
danielmai / 1_summary.md
Last active January 11, 2024 01:32
fio tests on aws instances

Summary: Fio tests

r5.2xlarge

r5.2xlarge instance in eu-west-1 with 200 GB EBS io1 volume and 3000 IOPS.

Keybase proof

I hereby claim:

  * I am danielmai on github.   * I am dmai (https://keybase.io/dmai) on keybase.   * I have a public key ASD5esbHAu4zoG-4hsJ5CQxsPbju-9ToEvCWAfqgfv8S0Ao

To claim this, I am signing this object:

@danielmai
danielmai / notes.org
Last active February 4, 2020 16:53
Notes for CS 152, Fall 2015.

Notes for CS 152

<2015-08-31 Mon>

Lab 1 solution

max-num

Without let bindings

(define (max-num lst)
@danielmai
danielmai / ForecastListToDetailTest.java
Created December 18, 2015 23:22
Espresso test for Sunshine. Demo for the Android Testing webcast in the Android Developer Nanodegree.
package com.example.android.sunshine.app.ui;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import com.example.android.sunshine.app.MainActivity;
import com.example.android.sunshine.app.R;
import org.junit.Rule;
@danielmai
danielmai / no_nul_char.pas
Last active August 31, 2015 03:45
Testing NUL character output from Pascal.
Program NoNulChar;
TYPE
Buffer = PACKED ARRAY[0..200] of char;
VAR
B : Buffer;
BEGIN
readln(B);
@danielmai
danielmai / toggle_sticky_keys.rb
Created August 29, 2015 23:58
Script to toggle sticky keys on OS X.
read = %x(defaults read com.apple.universalaccess | grep stickyKey)
if /stickyKey = 0;$/ =~ read
%x(defaults write com.apple.universalaccess stickyKey 1)
else
%x(defaults write com.apple.universalaccess stickyKey 0)
end
%x(killall universalaccessd)
@danielmai
danielmai / no_ctrl_k.js
Last active August 29, 2015 14:27
No Ctrl-K on Udacity Discussions
// ==UserScript==
// @name No Ctrl-K for Udacity Discussions!
// @namespace http://your.homepage/
// @version 0.1
// @description enter something useful
// @author You
// @match https://discussions.udacity.com/*
// @grant none
// ==/UserScript==