1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421<!DOCTYPE html>
<html lang="en-us">
<head>
<meta name="generator" content="Hugo 0.110.0">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta property="og:title" content="Mark Needham" />
<meta property="og:site_name" content="Mark Needham" />
<meta property="og:url" content="https://www.markhneedham.com/blog/" />
<meta property="og:type" content="website" />
<title>Mark Needham</title>
<meta name="description" content="" />
<meta name="p:domain_verify" content="fc173d84e3a4de948ed4bda2908afd3e"/>
<meta name="HandheldFriendly" content="True" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://www.markhneedham.com/blog/index.xml" rel="alternate" type="application/rss+xml" title="Mark Needham" />
<link rel="canonical" href="https://www.markhneedham.com/blog/" />
<style>
*{padding:0;margin:0}body,html{font-size:1em;line-height:1.65em;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;font-weight:300;color:#444}html{height:100%}body{padding:2em 2.5em 1em 20em}header{border-right:1px #eee solid;padding:2em;position:fixed;top:0;left:0;height:100%;width:13.5em}#content{display:block;width:100%}footer{padding:1em 0 2.5em;font-size:.8em;line-height:1.5em;color:#888}article{border-bottom:.1em #eee solid;padding-bottom:1.7em;max-width:56em}h4,h5,h6,hr,p{margin-top:.9em;margin-bottom:.9em}h1,h2,h3,h4,h5,h6{font-family:"Bree Serif",serif;font-weight:400!important}h1{font-size:2.5em;line-height:1.1em;margin-top:.6em;margin-bottom:.6em}h2{font-size:1.9em;line-height:1.2em;margin-top:.7em;margin-bottom:.7em}h3{font-size:1.4em;line-height:1.3em;margin-top:.8em;margin-bottom:.8em}h4{font-size:1.3em}h5{font-size:1.2em}h6{font-size:1.1em}iframe,img{max-width:100%}a{font-weight:700;text-decoration:none;color:#5cc265}a:hover{text-decoration:underline}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{font-weight:400!important}strong{font-weight:700}blockquote{border-left:.4em solid #008cc1;padding-left:1.2em;font-size:1.3em}hr{border:0;height:1px;background:#eee}ol,ul{margin-left:3em}code{font-size:1.1em;max-height: 500px;background:#0d1117}
pre{border-radius: .6em;font-size:.8em;line-height:1.7em;color:#c9d1d9;background:#0d1117;padding:2.0em 0.75em 2.0em 0.75em;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:-moz-pre-wrap;white-space:pre-wrap}input{font-size:1em;padding:.3em}header h1{font-size:1.9em;margin-top:.8em;margin-bottom:.6em}header h1 a{color:#444}header h1 a:hover{text-decoration:none}header #logo img{width:9em;height:9em;border-radius:4.5em;-moz-border-radius:4.5em;-webkit-border-radius:4.5em;border:none}#follow-icons{font-size:.7em;margin-top:-.7em;margin-bottom:1.5em}#follow-icons a{color:#ccc}#follow-icons span{vertical-align:top;margin-left:-.15em;margin-right:-.15em}#follow-icons span .fa-stack-1x{font-size:1.05em;line-height:1.9em}header h6{margin-top:.5em}article span.post-stamp{color:#888}h1.post-title{margin-top:.35em;margin-bottom:.6em}h3.post-title{margin-top:.4em;padding-bottom:.9em;border-bottom:1px solid #eee;font-size:1.2em;color:#444}.post-title .feature-star{font-size:.9em}.feature-star,.separator,.taglist{color:#ccc}.taglist a{background-color:#008cc1;color:#fff;display:inline-block;line-height:1.5em;padding:.3em .6em;vertical-align:20%;font-size:.5em;font-family:"Open Sans",sans-serif;font-weight:700!important;text-transform:uppercase;letter-spacing:.05em;border-radius:.25em;-moz-border-radius:.25em;-webkit-border-radius:.25em}#social-bar{margin-top:1.5em;background-color:#eee;padding:.5em}#comments{margin-top:.15em;padding-bottom:.2em;border-bottom:1px solid #eee}.pagination{margin-bottom:1em}footer a{font-weight:300;color:#888;text-decoration:underline}footer a:hover{color:#444;text-decoration:none}@media only screen and (min-width:1281px){body,html{font-size:1.1em}}@media only screen and (max-width:800px){body{padding:0}header{border-right:none;border-bottom:1px #eee solid;position:relative;height:auto;width:auto;text-align:center;padding-bottom:1em}#content{margin-left:0;padding:2em 2em 1em;width:auto}footer{padding:0 2.5em 2em}}@media only screen and (max-width:320px){#content,header{padding:1.2em 1.2em .6em}footer{padding:0 1.5em 1.2em}ol,ul{margin-left:2em}}
</style>
<style>
@media only screen and (max-width: 1000px) {
table, caption {
width: 100%;
overflow-x: auto;
display: block;
}
}
@media only screen and (max-width: 800px) {
#header {
padding: 5px;
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: center;
flex-wrap: nowrap;
overflow-x: auto;
padding: 5px;
}
#header a {
margin-bottom: -0.5em;
margin-right: 1em;
}
#header #logo img {
width: 30px;
height: auto;
}
#header h1 {
font-size: 1em;
margin-right: 1em;
}
#header p {
display: none;
}
#follow-icons a i {
font-size: 1em;
}
#follow-icons {
font-size: 1.5em;
margin-bottom: 0;
margin-top: 0;
}
#follow-icons a {
margin-right: 0;
}
}
p code, caption code, div.colist code, .hdlist1 code {
font-size:1.2em;
background:#fff
}
.hdlist1 {
font-weight: 700;
}
.dlist dd p {
margin-top: 0;
}
pre.highlight {
position: relative;
}
.label-right {
color: #FFF;
padding: 2px 5px;
border-radius: 0 0 0 0.25em;
font-size: 1.1em;
font-weight: 500;
position: absolute;
top: 0;
right: 0;
}
.green-icon {
color: lime;
}
.copy-button {
cursor: pointer;
margin-right: 0.25em;
padding: 0.25em 0 0 0;
}
.copy-notification {
position: absolute;
right: 0;
top: 0;
padding: 2px 5px;
background-color: #0d1117;
color: #fff;
}
.stretch{width:100%}
table{border-collapse:collapse;border-spacing:0}
table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede;}
table thead,table tfoot{background:#008cc1;}
table thead tr th{background:#008cc1;}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table thead tr th {color: #ffffff;}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8);}
table tr.even,table tr.alt,table tr:nth-of-type(even){background:#f8f8f7}
table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{display:table-cell;line-height:1.6;}
table.tableblock{max-width:100%;border-collapse:separate}
p.tableblock:last-child{margin-bottom:0; margin-top: 0;}
td.tableblock>.content{margin-bottom:-1.25em}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all>thead>tr>.tableblock,table.grid-all>tbody>tr>.tableblock{border-width:0 1px 1px 0}
table.grid-all>tfoot>tr>.tableblock{border-width:1px 1px 0 0}
table.grid-cols>*>tr>.tableblock{border-width:0 1px 0 0}
table.grid-rows>thead>tr>.tableblock,table.grid-rows>tbody>tr>.tableblock{border-width:0 0 1px}
table.grid-rows>tfoot>tr>.tableblock{border-width:1px 0 0}
table.grid-all>*>tr>.tableblock:last-child,table.grid-cols>*>tr>.tableblock:last-child{border-right-width:0}
table.grid-all>tbody>tr:last-child>.tableblock,table.grid-all>thead:last-child>tr>.tableblock,table.grid-rows>tbody>tr:last-child>.tableblock,table.grid-rows>thead:last-child>tr>.tableblock{border-bottom-width:0}
table.frame-all{margin-top: 0.5em;}
table.frame-sides{border-width:0 1px}
table.frame-topbot,table.frame-ends{border-width:1px 0}
table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd){background:#f8f8f7}
table.stripes-none tr,table.stripes-odd tr:nth-of-type(even){background:none}
th.halign-left,td.halign-left{text-align:left}
th.halign-right,td.halign-right{text-align:right}
th.halign-center,td.halign-center{text-align:center}
th.valign-top,td.valign-top{vertical-align:top}
th.valign-bottom,td.valign-bottom{vertical-align:bottom}
th.valign-middle,td.valign-middle{vertical-align:middle}
table thead th,table tfoot th{font-weight:bold}
tbody tr th{display:table-cell;line-height:1.6;background:#f7f8f7}
tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
p.tableblock>code:only-child{background:none;padding:0}
td>div.verse{white-space:pre}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock,th.tableblock{font-size:0.8em}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#008cc1;font-weight:350;margin-top:.75em;margin-bottom:.25em}
.listingblock>.title {
background: linear-gradient(90deg, rgba(151,231,255,1) 0%, rgba(0,140,193,1) 35%, rgba(151,231,255,1) 100%);
padding: 0.4em;
color: black;
margin-bottom: 0;
font-size: 0.7em;
font-weight: 600;
border-radius: 0.6em 0.6em 0 0;
}
.listingblock div.content {
max-height: 500px;
overflow-y: auto;
}
.listingblock>.title + div.content pre {
border-radius: 0 0 .6em .6em;
}
.listingblock:has(code[data-lang="text"]) > .title {
text-transform: uppercase;
}
.admonitionblock {
margin: 0 0 1.5rem;
border-left: 4px solid #000000;
border-radius: .25rem;
}
.admonitionblock.note {
background-color: #edf2f7;
color: #19407c;
border-left-color: #718096;
}
.admonitionblock.warning {
background-color: #fff6e6;
color: #19407c;
border-left-color: #FFA500;
}
.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
.admonitionblock>table td.icon{text-align:center;display:none;}
.admonitionblock>table td.icon img{max-width:none}
.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6)}
.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
tbody tr pre {margin-bottom: 27px}
.colist, .dlist, .exampleblock, .imageblock, .listingblock, .literalblock, .olist, .paragraph, .partintro, .quoteblock, .sidebarblock, .ulist, .verseblock {
margin: 0 0 1.5rem;
}
.colist {
margin: 0;
}
.colist table {
margin: 0;
border: none;
}
.conum { display: inline-block; color: white !important; background-color: #008cc1; -webkit-border-radius: 100px; border-radius: 100px; text-align: center; width: 20px; height: 20px; font-size: 12px; font-weight: bold; line-height: 20px; font-family: Arial, sans-serif; font-style: normal; position: relative; top: -2px; letter-spacing: -1px; }
.conum * { color: white !important; }
.conum + b { display: none; }
.conum:after { content: attr(data-value); }
.conum:not([data-value]):empty { display: none; }
.colist>table tr>td:first-of-type{ border:0; min-width:0; padding:0 .75em;}
.colist>table tr>td:last-of-type{ border:0; min-width:0; padding:.25em 0}
.colist>table tr:nth-child(even) { background:0 0 }
.listingblock + .colist {
margin-top: -0.7rem;
}
h2 code {
background: #ffffff;
}
</style>
</head>
<body>
<header id="header">
<a id="logo" href="https://www.markhneedham.com/blog/"><img src="https://www.markhneedham.com/blog//me.jpg" alt="Mark Needham" /></a>
<h1><a href="https://www.markhneedham.com/blog/">Mark Needham</a></h1>
<p></p>
<div id="follow-icons">
<a href="http://twitter.com/markhneedham" rel="me"><i class="fa fa-twitter-square fa-2x"></i></a>
<a href="https://www.youtube.com/channel/UCKEk670ECmteGBehmDjVSSg" rel="me"><i class="fa fa-youtube-square fa-2x"></i></a>
<a href="http://linkedin.com/in/markhneedham" rel="me"><i class="fa fa-linkedin-square fa-2x"></i></a>
<a href="http://github.com/mneedham" rel="me"><i class="fa fa-github-square fa-2x"></i></a>
<a href="mailto:m.h.needham@gmail.com"><i class="fa fa-envelope-square fa-2x"></i></a>
<a href="https://www.markhneedham.com/blog/index.xml" rel="me"><i class="fa fa-rss-square fa-2x"></i></a>
</div>
</header>
<main id="content">
<section class="2009">
<h3 class="post-title">
<a href="https://www.markhneedham.com/blog/2009/04/11/the-mythical-man-month-book-review/"></a>
<div>
<time datetime="0001-01-01T00:00:00Z">
1 Jan 0001
</time>
<span class="taglist">
</span>
</div>
</h3>
</section>
<section class="2017">
<h3 class="post-title">
<a href="https://www.markhneedham.com/blog/2017/04/27/python-flask-generating-a-static-html-page/"></a>
<div>
<time datetime="0001-01-01T00:00:00Z">
1 Jan 0001
</time>
<span class="taglist">
</span>
</div>
</h3>
</section>
<nav class="pagination">
<a class="newer-posts" href="/blog/page/190/">← Newer Posts</a>
<span class="page-number">Page 191 of 191</span>
</nav>
</main>
<footer id="footer">
<section id="footer-message">© Mark Needham. All rights reserved. Powered by <a href="http://gohugo.io" target="_blank">Hugo</a>. <a href="https://github.com/kathyqian/crisp-ghost-theme" target="_blank">Crisp</a> theme by <a href="http://kathyqian.com" target="_blank">Kathy Qian</a>.</section>
</footer>
<script>
(function(c,f){asyncLoader=function(i,h){i.foreach(function(k,j){e(j,d(j),h)});if(typeof h.callback=="function"){var g=setInterval(function(){if(f.readyState==="complete"){clearInterval(g);h.callback()}},10)}};var d=function(g){var h=g.split(".");return h[h.length-1]},e=function(h,i,g){switch(i){case"js":a(h,g);break;case"css":b(h);break;default:break}},a=function(i,h){var g=document.createElement("script");g.type="text/javascript";g.async=true;g.src=i;document.getElementsByTagName("head")[0].appendChild(g)},b=function(g){var h=document.createElement("link");h.type="text/css";h.rel="stylesheet";h.href=g;document.getElementsByTagName("head")[0].appendChild(h)};Array.prototype.foreach=function(h){for(var g=0;g<this.length;g++){h(g,this[g])}}})(this,document);
var WebFontConfig={google:{families:["Open Sans:300italic,700italic,300,700","Bree+Serif"]}};
asyncLoader([
"//netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.css",
"//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js",
"//cdnjs.cloudflare.com/ajax/libs/webfont/1.5.16/webfontloader.js",
"//unpkg.com/@highlightjs/cdn-assets@10.7.2/highlight.min.js"
],{
callback:function(){
asyncLoader([
"https:\/\/www.markhneedham.com\/blog\/css/rrssb.css",
"https:\/\/www.markhneedham.com\/blog\/css/github-dark.css",
"https:\/\/www.markhneedham.com\/blog\/js/image-zoom.js",
"https:\/\/www.markhneedham.com\/blog\/js/gist.min.js",
"https:\/\/www.markhneedham.com\/blog\/js/rrssb.min.js",
"https://unpkg.com/highlightjs-cypher/dist/cypher.min.js",
], { callback:function() {
document.querySelectorAll('pre code').forEach((block) => {
hljs.highlightElement(block);
var language = block.result.language;
if(language && language !== "text") {
const originalCode = block.textContent.trim();
const labelAndButtonHTML = `
<span class="label-and-button">
<label class="label-right">${language.toUpperCase()}</label>
<i class="copy-button fa fa-copy"></i>
</span>
`;
block.insertAdjacentHTML("afterbegin", `<label class="label-right">${language.toUpperCase()} <i class="copy-button fa fa-copy"></i></label>`);
const button = block.querySelector('.copy-button');
button.addEventListener('click', (event) => {
var code = button.parentElement.textContent;
navigator.clipboard.writeText(originalCode).then(function() {
button.classList.remove('fa-copy'); // Remove the copy icon class
button.classList.add('fa-check', 'green-icon');
setTimeout(function() {
button.classList.remove('fa-check', 'green-icon');
button.classList.add('fa-copy');
}, 2000);
}, function(err) {
console.error('Could not copy code to clipboard: ', err);
});
});
}
});
}});
}
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-KVLB7W6R20"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-KVLB7W6R20');
</script>
</body>
</html>