Skip to content

Instantly share code, notes, and snippets.

View mehaase's full-sized avatar

Mark E. Haase mehaase

View GitHub Profile
server {
# ...other server stuff here, e.g. TLS...
location / {
rewrite ^/(packages/.*|index.html|main\..*) /$1 break;
rewrite ^/.* /index.html;
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
}
}
@mehaase
mehaase / extract_vocab.py
Created August 3, 2016 05:25
extract dictionary words from a strnig
with open('/usr/share/dict/american-english') as vocab_file:
_vocab = {line.strip() for line in vocab_file}
def _extract_words(string, min_=3):
''' Return set of maximal length, non-overlapping dictionary words in `string`. '''
words = set()
candidate_len = len(string)
while candidate_len >= min_:
for start in range(0, len(string) - candidate_len + 1):
candidate = string[start:start+candidate_len]

Keybase proof

I hereby claim:

  • I am mehaase on github.
  • I am mehaase (https://keybase.io/mehaase) on keybase.
  • I have a public key whose fingerprint is BF91 D496 A3D4 01A7 34C2 64E4 8E7E F260 1A7F E635

To claim this, I am signing this object: