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 / Moss-README.rst
Last active March 3, 2024 11:16
Some words on getting started with Moss.

Checking Plagiarism with Moss

Moss (Measure of Software Similarity) is a service that is used to check for plagiarism with programming assignments.

Getting Started with Moss

Moss is simply a command-line script that sends the program files to a server. You

@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.

@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 / _README.md
Last active May 28, 2021 19:08 — forked from mjpitz/_README.md
dgraph troubles
@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 / 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

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 / 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)