Skip to content

Instantly share code, notes, and snippets.

View markrwilliams's full-sized avatar

Mark Williams markrwilliams

View GitHub Profile
#!/bin/sh -x
die () {
msg="$1"
echo $msg 1>&2
exit 1
}
prep_sqlite() {
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
tectonic:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
tectonic:
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests

ufork

Server Software:
Server Hostname:        localhost
Server Port:            8080

Document Path:          /
Document Length:        38 bytes

Concurrency Level:      100

Time taken for tests: 31.591 seconds

import os
import re
class FilePerms(object):
class _fp_field(object):
def __init__(self, attribute):
self.attribute = attribute
import argparse
import parsley
def make_argparser(reqs):
argparser = argparse.ArgumentParser()
for req in reqs:
argparser.add_argument('--' + req)
return argparser
import argparse
import parsley
def make_argparser(reqs):
argparser = argparse.ArgumentParser()
for req in reqs:
argparser.add_argument('--' + req)
return argparser
(defun python-swap-quotes ()
(interactive)
(save-excursion
(let ((state (syntax-ppss)))
(when (eq 'string (syntax-ppss-context state))
(let* ((left (nth 8 state))
(right (1- (scan-sexps left 1)))
(newquote (if (= ?' (char-after left))
?\" ?')))
(dolist (loc (list left right))
import os
import io
FN = 'thefile'
with open(FN, 'w') as f:
f.write(b'abcdefgh\n'
b'ijlkmnop\n'
b'qrstuwxyz\n')