Skip to content

Instantly share code, notes, and snippets.

View Momijiichigo's full-sized avatar
💨
phew

Daichi Momijiichigo

💨
phew
View GitHub Profile
@Momijiichigo
Momijiichigo / _Eww Wallpaper Clock Widget.md
Last active July 11, 2024 00:37
Eww Wallpaper Clock Widget

image image

@Momijiichigo
Momijiichigo / MyString.ts
Last active May 22, 2022 05:02
MyString
class MString {
private static encoder = new TextEncoder()
private static decoder = new TextDecoder()
private static DEFAULT_BUFFER = new ArrayBuffer(0)
private static DEFAULT_VIEW = new DataView(MString.DEFAULT_BUFFER)
private static DEFAULT_BORDER_INDEXES = new Array<number>()
/**
* Memory buffer where raw string byte data are stored
*/
private buffer: ArrayBuffer = MString.DEFAULT_BUFFER
@Momijiichigo
Momijiichigo / _Matrix_Char_Rain.md
Last active May 13, 2024 10:49
Matrix Char Rain

Matrix Char Rain

Image

copy from my old repo.

run the script in node.js

Update

added Rust version.

@Momijiichigo
Momijiichigo / _Wait_Exec.md
Last active January 31, 2022 04:23
waitExec

Wait Exec

A simple way to make process wait for multiple conditions.

This is similar to Promise.all but WaitExec allows you to register conditions flexibly.

It's useful to export waitMe so that you can add conditions from other files.

@Momijiichigo
Momijiichigo / Easy_Easing.md
Last active January 26, 2022 04:34
Easy Easing

Easy Easing

easy to use smooth transition function with requestAnimationFrame

@Momijiichigo
Momijiichigo / _Lazy_Iteration_Chain.md
Last active January 25, 2022 05:15
efficient chain-methods for array (lazy iteration)

Efficient chain-methods for array (lazy iteration)

Why I made this

People like to use chain methods like .map, but these are sometimes not efficient. I just made a program that iterates using lazy approach.

  • The result array is evaluated only at the end of chains (with .collect method)
  • The difference is that the native method creates every single result arrays for each chain process.
  • There is no full compatibility with the native methods.

After I took benchmark, I noticed that:

@Momijiichigo
Momijiichigo / towerOfHanoi.py
Last active July 8, 2023 08:31
Tower of Hanoi on terminal
from time import sleep
bar = [[], [], []]
numOfDisks = 1
barName = ['left', 'middle', 'right']
def move(bfrom, to, disk):
moveTo = 0
while True:
if moveTo != bfrom and moveTo != to:
break
else:
@Momijiichigo
Momijiichigo / 謎の文通.md
Last active May 20, 2021 16:28
謎の文通

とんでもなく くだらないことを思いついたのでメモを残しておくぅ! 

(アドレス出力のサイズをできるだけ小さくするためにコードの見た目が醜いと思うけど、許してちょ)

const genURL = (msg) => 'data:text/html;charset=utf-8,'+encodeURIComponent(`
<html><head><title>謎の文通</title></head><body><script>
const genURL = ${genURL.toString()}
alert('${msg}')