Skip to content

Instantly share code, notes, and snippets.

View benjamintanweihao's full-sized avatar

Benjamin Tan Wei Hao benjamintanweihao

View GitHub Profile
  1. Quickcheck
  2. Paxos
  3. A database
  4. A real time networked game across the Internet
  5. A type system
  6. A prover
  7. A process scheduler
  8. A shader
  9. A gpu accelerated math problem
  10. An operating system for a microcomputer with less than 640k ram
module CounterList (..) where
import Counter
import Html exposing (..)
import Html.Events exposing (..)
import StartApp.Simple exposing (start)
-- MODEL
module Counter (..) where
import Html exposing (..)
import Html.Events exposing (..)
import StartApp.Simple exposing (start)
-- MODEL
@benjamintanweihao
benjamintanweihao / emacs.md
Created May 2, 2016 14:02
Starting Emacs in windowed mode

To start emacs with windowed mode

#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$@"

Place the following in ~/bin

# Rank on ease of working with
1 - Hard, 5 - Trivial
* UI/Styling (4)
Themes and 'styles' are easily defined for the application, Material design (themes, widgets, icons) natively supported.
When extending a class of a widget, the preview doesn't show, even though that class might not have any additions.
* Integration testing
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
-import(lists, [seq/2]).
%%% Alphanumeric characters ([a-zA-Z0-9]).
alnum() -> list(oneof(seq($a, $z) ++ seq($A, $Z) ++ seq($0, $9))).
%%% Alphabetic characters ([a-zA-Z]).
alpha() -> list(oneof(seq($a, $z) ++ seq($A, $Z))).
%%% ASCII characters ([\x00-\x7F]).
ascii() -> list(oneof(seq(0, 127))).
#!/usr/bin/env bash
#
# runs Concuerror
#
set +x
# Path to Concuerror
CONC=../../erlang/Concuerror/concuerror
# Path to Elixir
ELIXIR=../elixir-1.0.2/lib/elixir/ebin
@benjamintanweihao
benjamintanweihao / navigation_drawer_espresso.java
Last active July 16, 2020 13:38
Testing Navigation Drawer in Espresso
// This works!
onView(withId(R.id.drawer)).perform(swipeUp())
// This doesn't.
onView(withId(R.id.drawer))
.perform( actionOnItemAtPosition(5, click()));
onView(allOf(
withText(R.string.settings),
function get(url) {
return Rx.Observable.create(function(observer) {
var req = new XMLHttpRequest();
req.open('GET', url);
req.onLoad = function() {
if (req.status == 200) {
observer.onNext(req.response);
observer.onCompleted();
}