I hereby claim:
- I am lamchau on github.
- I am lamchau (https://keybase.io/lamchau) on keybase.
- I have a public key ASBoE71vaOJxbOm7RBqhXpHGK3SGQG-EaLeJbenoei77Owo
To claim this, I am signing this object:
const Mocha = require('mocha'); | |
const expect = require('chai').expect; | |
const mocha = new Mocha(); | |
/** | |
Welcome to the One Medical Lab! We have a number of items in stock to make sure | |
we can keep our patients happy and healthy. | |
In our lab, our items degrade in quality as they approach their expiration | |
date. In order to keep track of this, we have a service that updates our |
I hereby claim:
To claim this, I am signing this object:
FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.
package com.samsara; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import org.junit.Assert; | |
import org.junit.Test; | |
public class FindAlertRanges { |
#!/usr/bin/env python | |
""" | |
Starts a Tornado static file server in a given directory. | |
To start the server in the current directory: | |
tserv . | |
Then go to http://localhost:8000 to browse the directory. | |
Use the --prefix option to add a prefix to the served URL, |
const WORDS_MAP = Object.freeze({ | |
0: 'zero', | |
1: 'one', | |
2: 'two', | |
3: 'three', | |
4: 'four', | |
5: 'five', | |
6: 'six', | |
7: 'seven', | |
8: 'eight', |
/* | |
Justify a string | |
Given an input string of words and spaces, and a desired line length n which is greater than or equal | |
to the length of the input string, output a string that differs only in whitespace from the original | |
string which meets the following requirements: | |
- the new string has length n | |
- no spaces before the first word | |
- no spaces after the last word | |
- the number of spaces between a pair of consecutive words differs by no more than 1 from the |
class Solution { | |
public static List<List<Integer>> prettyPrint(int A) { | |
List<List<Integer>> list = new ArrayList<>(); | |
// rows/columns (nxn) | |
final int columns = A + (A - 1); | |
final int midpoint = columns / 2; | |
// track current layer | |
int layer = 1; |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
const bowser = require('bowser'); | |
const FULL_SEMVER = /^(\d+)\.(\d+)\.(\d+)[\+|\-]?(.*)?$/; | |
const MAJOR_MINOR_VERSION = /^(\d+)\.(\d+)[\+|\-]?(.*)?$/; | |
const ANY_DIGIT = /^(\d+)$/; | |
function parseVersion(str) { | |
const [, major, minor, patch, metadata] = | |
FULL_SEMVER.exec(str) || | |
MAJOR_MINOR_VERSION.exec(str) || |