summaryrefslogtreecommitdiff
path: root/content/posts/code_test.md
blob: 07744f74e81d3b364804e630e895176bc39e671c (plain)
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
+++
title = "Test code syntax highlight"
date = 2020-10-13
draft = false

[taxonomies]
tags = ["test", "code"]

[extra]
disable_comments = true
toc = false

[extra.earlier]
title = "Typography"
permalink = "https://alphara.art/posts/typography"

[extra.later]
title = "Henlo Internet!"
permalink = "https://alphara.art/posts/how-i-made-this-blog-with-zola/"
+++

```rust
fn factorial(n: u64) -> u64 {
    match n {
        0 => 1,
        _ => n * factorial(n-1)
    }
}
```

```typescript
const sum = (n: number) =>  n * (n + 1) / 2
```

```python
### multi-threading

import os ; n_cores = os.cpu_count() // 2 ;

from concurrent.futures import ThreadPoolExecutor

with ThreadPoolExecutor(max_workers=n_cores) as executor:
    executor.map(render, range(0, len(image_array)))
```