Skip to content

Instantly share code, notes, and snippets.

@r-malon
r-malon / kana.xml
Created November 27, 2025 19:30
Kana learning layout for Unexpected Keyboard
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<keyboard name="Kana" script="kana" lang="ja" locale_extra_keys="false">
<!-- Shift to Katakana -->
<modmap>
<shift a="あ" b="ア"/> <shift a="い" b="イ"/> <shift a="う" b="ウ"/> <shift a="え" b="エ"/> <shift a="お" b="オ"/>
<shift a="か" b="カ"/> <shift a="き" b="キ"/> <shift a="く" b="ク"/> <shift a="け" b="ケ"/> <shift a="こ" b="コ"/>
<shift a="さ" b="サ"/> <shift a="し" b="シ"/> <shift a="す" b="ス"/> <shift a="せ" b="セ"/> <shift a="そ" b="ソ"/>
<shift a="た" b="タ"/> <shift a="ち" b="チ"/> <shift a="つ" b="ツ"/> <shift a="て" b="テ"/> <shift a="と" b="ト"/>
<shift a="な" b="ナ"/> <shift a="に" b="ニ"/> <shift a="ぬ" b="ヌ"/> <shift a="ね" b="ネ"/> <shift a="の" b="ノ"/>
<shift a="は" b="ハ"/> <shift a="ひ" b="ヒ"/> <shift a="ふ" b="フ"/> <shift a="へ" b="ヘ"/> <shift a="ほ" b="ホ"/>
@r-malon
r-malon / demo.txt
Last active March 23, 2020 18:37
Pseudo-code for my demosaicing algorithms
function demosaic(img)
{
largura, altura = img.tamanho
R, G, B = 0, 1, 2
for (int x = 0; x < largura; x++)
{
for (int y = 0; y < altura; y++)
{
red = ( img[x - 1, y - 1][R] + img[x + 1, y + 1][R] ) / 2
@r-malon
r-malon / img_editor.py
Last active April 28, 2019 19:22
Image Editor Sketch
from tkinter import *
from tkinter import messagebox
from tkinter import filedialog
from PIL import ImageGrab
def locate(event):
global x
global y
x = event.x
y = event.y
@r-malon
r-malon / monokai.md
Created February 27, 2019 19:15
Monokai colors in RGB and HEX format, taken from Sublime Text 3

Monokai Colors in RGB and HEX format


  • Background: (46, 46, 46); #2e2e2e
  • Comments: (121, 121, 121); #797979
  • White: (214, 214, 214); #d6d6d6
  • Yellow: (229, 181, 103); #e5b567
  • Green: (180, 210, 115); #b4d273
  • Orange: (232, 125, 62); #e87d3e
  • Purple: (158, 134, 200); #9e86c8
@r-malon
r-malon / armstrong_number.py
Created February 23, 2019 20:04
Checks if a given number is an Armstrong number.
def armstrong(n):
n = str(n)
soma = 0
for i in n:
soma += int(i)**len(n)
return soma == int(n)
if __name__ == '__main__':
number = 407
print(f"Is {number} an Armstrong number? ", armstrong(number))