Skip to content

Instantly share code, notes, and snippets.

View curioustorvald's full-sized avatar

CuriousTorvald curioustorvald

View GitHub Profile
@curioustorvald
curioustorvald / korean_ime_on_ubuntu_based.md
Last active June 14, 2020 03:41
리눅스에서 한글 입력 설정 (두벌식, 세벌식, 드보락, 콜맥)

데비안/우분투 혹은 두벌식+쿼티 사용자를 위한 설정

  1. 리눅스를 영어로 설치, 레이아웃은 일단은 무조건 Qwerty
  2. sudo add-apt-repository ppa:createsc/3beol && apt-get update
  3. sudo apt install libhangul1 (확장 libhangul 모듈)
  4. sudo apt install fcitx-hangul (입력기 설치)
  5. 로그아웃 혹은 재부팅
  6. 설치 후 메뉴에서 fcitx를 실행
  7. 메뉴에서 fcitx configuration을 실행
  8. 설정 창에서 + 버튼으로 "hangul" 이라는 레이아웃 추가 (only show current language 체크 해제)
@curioustorvald
curioustorvald / UnsafePtr.kt
Last active January 2, 2024 20:17
Java/Kotlin unsafe pointer for unsafe array
package net.torvald
import sun.misc.Unsafe
/**
* Created by minjaesong on 2019-06-21.
*/
object UnsafeHelper {
internal val unsafe: Unsafe
@curioustorvald
curioustorvald / PasswordBase32.kt
Created February 4, 2019 17:05
Byte-to-Password encoder using Base32 using your plaintext and passphrase
import kotlin.experimental.xor
/**
* Old-school passworld system using Base32
*
* Created by minjaesong on 2017-05-02.
*/
object PasswordBase32 {
@curioustorvald
curioustorvald / THX.java
Last active June 8, 2018 15:41 — forked from Jobarion/THX.java
THX Deep Note Generator
Git-ified to minjaesong/TEE-H-AXE-Deep-Note-Generator
https://github.com/minjaesong/TEE-H-AXE-Deep-Note-Generator
@curioustorvald
curioustorvald / colourofglass.md
Last active August 8, 2017 01:59
Colour of household glass pane

While we were replacing old, failing windows and their frames to make it water-tight, I've got a chance to measure a colour of a stack of household glass (they were standing vertically ofc).

As we all know, household glass windows has green tint because of iron impurities.

These are raw readings gathered from Spyder5.

Result is XYZ: 236.516406 370.948442 333.504903, Yxy: 370.948442 0.251354 0.394219
Result is XYZ: 238.322408 373.685700 335.954159, Yxy: 373.685700 0.251405 0.394199
Result is XYZ: 287.492275 451.004721 417.299381, Yxy: 451.004721 0.248740 0.390211
@curioustorvald
curioustorvald / bfvm.kts
Last active April 30, 2017 11:19
BrainFuck VM: Needlessly complex brainfuck interpreter
import java.io.InputStream
import java.io.OutputStream
/**
* Just to make things slow down
*
* This version of Brainfuck fills memory with sanitised input program, and initialises
* memory pointer to be just right after your input program. This brings three major improvements:
*
* 1. Possibility of Self-modifying code
@curioustorvald
curioustorvald / ByteArray64.kt
Last active April 11, 2017 19:28
ByteArray that can hold larger than 4 GiB of data
/**
* ByteArray that can hold larger than 4 GiB of Data.
*
* Works kind of like Bank Switching of old game console's cartridges which does same thing.
*
* Created by Minjaesong on 2017-04-12.
*/
class ByteArray64(val size: Long) {
private val bankSize: Int = 1 shr 30 // 2^30 Bytes, or 1 GiB
@curioustorvald
curioustorvald / Slick2dTransparencyTricks.md
Created March 1, 2017 13:22
Tricks to properly drawing semi-transparent images in Slick2d
  1. Use TGA with Alpha instead of PNG. Grab yourself Paint.NET or GIMP and export the image as 32-bit TGA (no compression). Note that Photoshop can't do the job.
  2. Try this code as blend mode, this code must precede your drawing jobs:
import org.lwjgl.opengl.*

...

GL11.glEnable(GL11.GL_BLEND);
GL11.glColorMask(true, true, true, true);
GL14.glBlendFuncSeparate(