Skip to content

Instantly share code, notes, and snippets.

View alannnna's full-sized avatar

Alanna Tempest alannnna

View GitHub Profile
@alannnna
alannnna / ShowImage.kt
Last active June 29, 2020 01:13
Show a scrimage image in Kotlin (Mac only)
import com.sksamuel.scrimage.ImmutableImage
import com.sksamuel.scrimage.nio.PngWriter
import java.io.File
// Show image
// Implementation based on:
// https://github.com/python-pillow/Pillow/blob/77c098b01ffd599ec555d22ac76fd16563f4946f/src/PIL/ImageShow.py#L150-L162
fun ImmutableImage.show() {
// Save image to a temp file
val f = File.createTempFile("tmp", ".png")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alannnna
alannnna / output.txt
Created August 19, 2015 22:11
More signal handling
a@air-2:~/things$ python test_signals.py
parent process pid: 90614
90615 0
90616 1
90617 2
90618 3
90619 4
90620 5
90621 6
90622 7
@alannnna
alannnna / output.txt
Created August 19, 2015 21:39
signal handling confusion
a@air-2:~/things$ python test_signals.py
parent process pid: 90156
signal handled in proc 90156
90157 0
90158 1
90159 2
90160 3
90161 4
90162 5
90163 6