Parcourir la source

Add old wiki content

master
Chris Smith il y a 5 ans
Parent
révision
e3c4537b15

+ 3
- 0
content/docs/programming/_index.adoc Voir le fichier

@@ -0,0 +1,3 @@
1
+---
2
+title: "Programming"
3
+---

+ 13
- 0
content/docs/programming/golang.adoc Voir le fichier

@@ -0,0 +1,13 @@
1
+---
2
+title: "Golang"
3
+---
4
+== Golang
5
+
6
+=== Handling interrupts
7
+
8
+[source,golang]
9
+----
10
+c := make(chan os.Signal, 1)
11
+signal.Notify(c, os.Interrupt)
12
+signal.Notify(c, syscall.SIGTERM)
13
+----

+ 33
- 0
content/docs/programming/kotlin.adoc Voir le fichier

@@ -0,0 +1,33 @@
1
+---
2
+title: "Kotlin"
3
+---
4
+== Kotlin
5
+
6
+=== Assorted coroutine notes
7
+
8
+* *launched* in the context of a scope, e.g. `GlobalScope`
9
+* `launch` and `runBlocking` are both builders
10
+** Can parameterise `runBlocking` for e.g. tests - `runBlocking<Unit> {...}`
11
+** Builders return a job, can call `job.join()` to wait, `job.cancel()` to stop
12
+** Every builder adds a `CoroutineScope` to the scope of a code block
13
+** `launch`/`runBlocking` operate on current scope
14
+* `coroutineScope` is a builder to manually create a scope
15
+* `suspend` functions don't carry the scope
16
+** keep a reference in the class/fun
17
+** make them an extension method on CoroutineScope
18
+* Coroutines launched in `GlobalScope` don't keep the process alive if `main()` returns
19
+* Cancellation is co-operative - must throw `CancellationException`
20
+** Can check `isAlive` property
21
+** `withContext(NonCancellable)` if job *can't* be cancelled (e.g. suspend fun in a finally block)
22
+* `withTimeout` and `withTimeoutOrNull` cancel automatically
23
+* Children can be cancelled with `coroutineContext.cancelChildren()`
24
+* `async` is like `launch` but returns a `Deferred`
25
+* Contexts are job + dispatcher
26
+* Dispatcher specifies thread to run on
27
+* Launchers take an optional context
28
+** `launch(newSingleThreadContext("name")) {...}`
29
+* `GlobalScope`'s dispatcher uses a shared threadpool
30
+* Can get own job from `CoroutineContext[Job]`
31
+* `CoroutineName` gives named context
32
+** Can concat contexts with `+`
33
+* `select` can receive data from multiple channels, like Go

+ 3
- 0
content/docs/software/_index.adoc Voir le fichier

@@ -0,0 +1,3 @@
1
+---
2
+title: "Software"
3
+---

+ 6
- 0
content/docs/software/alpine.adoc Voir le fichier

@@ -0,0 +1,6 @@
1
+---
2
+title: "Alpine"
3
+---
4
+== Alpine
5
+
6
+* The equivalent of Ubuntu's `build-essential` is `build-base`

+ 11
- 0
content/docs/software/git.adoc Voir le fichier

@@ -0,0 +1,11 @@
1
+---
2
+title: "Git"
3
+---
4
+== Git
5
+
6
+Clean up merged branches:
7
+
8
+[source,console]
9
+----
10
+$ git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
11
+----

+ 11
- 0
content/docs/software/linux.adoc Voir le fichier

@@ -0,0 +1,11 @@
1
+---
2
+title: "Linux"
3
+---
4
+== Linux
5
+
6
+* `iotop` adjusts priorities of I/O - `-c 3` is 'when idle'
7
+
8
+=== Resizing disks
9
+
10
+1. `fdisk` to delete and recreate the partition
11
+2. `resize2fs` to resize to the new partition

+ 9
- 0
content/docs/software/miniflux.adoc Voir le fichier

@@ -0,0 +1,9 @@
1
+---
2
+title: "Miniflux"
3
+---
4
+== Miniflux
5
+
6
+=== Rewrite rules
7
+
8
+* add_dynamic_image
9
+* add_image_title

+ 6
- 0
content/docs/software/windows.adoc Voir le fichier

@@ -0,0 +1,6 @@
1
+---
2
+title: "Windows"
3
+---
4
+== Windows
5
+
6
+* Win+Shift+S launches snipping tool in rectangle selection

+ 3
- 0
content/docs/technologies/_index.adoc Voir le fichier

@@ -0,0 +1,3 @@
1
+---
2
+title: "Technologies"
3
+---

+ 27
- 0
content/docs/technologies/irc.adoc Voir le fichier

@@ -0,0 +1,27 @@
1
+---
2
+title: "IRC"
3
+---
4
+== IRC
5
+
6
+=== WIP History of IRC
7
+
8
+* August 1988, first IRC server in use <<1>>
9
+* November 1988, international links established <<1>>
10
+* August 1990, EFNet splits from ANet <<1>> -- history?
11
+* December 1992, Undernet created <<1>> -- history?
12
+* May 1993, RFC published <<1>> -- better source
13
+* July 1994, Dalnet formed <<1>> -- history?
14
+* July 1996, IRCnet and EFnet split ("The Great Split") <<1>> -- history?
15
+* June 1998, IRCX <<3>>
16
+* 1998, Freenode (Open Project Network) started <<1>> -- history?
17
+* April 2000, RFC2812 <<4>>
18
+* 2002 - OPN becomes Freenode <<5>>
19
+
20
+==== Sources
21
+
22
+[bibliography]
23
+- [[[1]]]: https://daniel.haxx.se/irchistory.html
24
+- [[[2]]]: http://www.irc.org/history_docs/jarkko.html
25
+- [[[3]]]: https://tools.ietf.org/html/draft-pfenning-irc-extensions-04
26
+- [[[4]]]: https://tools.ietf.org/html/rfc2812
27
+- [[[5]]]: https://en.wikipedia.org/wiki/Openprojects

Chargement…
Annuler
Enregistrer