Skip to content

Instantly share code, notes, and snippets.

@iacore
iacore / readme.txt
Created February 24, 2023 05:35
Indigestion (Puzzlescript Plus Script)
Play this game by pasting the script in https://auroriax.github.io/PuzzleScript/editor.html
@iacore
iacore / index.tsx
Created February 5, 2023 14:15
Qwik + RxJs
import {
component$,
useSignal,
$,
} from "@builder.io/qwik"
import { loader$, DocumentHead } from "@builder.io/qwik-city"
import { scan, Subject } from "rxjs"
export const timeLoader = loader$(() => new Date())
@iacore
iacore / .gitignore
Last active December 8, 2022 19:35
katla runner
out/
@iacore
iacore / testimg.nim
Created June 30, 2022 09:40 — forked from demotomohiro/testimg.nim
Realtime pixel drawing
import std/[strformat, strutils, bitops]
import pixie, chroma
# define `nort` when opengl or windows system is not available.
when not defined(nort):
import nimgl/[glfw, opengl]
proc `{}`(image: var Image, x, y: int): var ColorRGBX =
## Accessing any pixels outside the bounds of the image is error
when not defined(danger):
@iacore
iacore / ConstCaller.rakumod
Created June 22, 2022 21:09
use "constant" function sigilless
=begin pod
Example Usage:
=begin code
use OpenGL::GLFW:from<Perl5> qw<:all>;
use lib ".";
use ConstCaller;
constant GLFW = ConstCaller.new :package(OpenGL::GLFW.WHO) :prefix<GLFW>;
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions: [p6, pm6, pod6, raku, rakumod, rakudoc, rakutest, nqp, crotmp]
scope: source.raku
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
import Data.Colist
InfiniteBits : Type
InfiniteBits = Colist Bool
-- 1.bits << n
record RealData where
constructor MkRealData
n: Int
bits: InfiniteBits
@iacore
iacore / readme.md
Last active May 30, 2022 16:31
Async run times in Rust
  • SIGSEGV proof: able to handle SIGFPE/SIGABRT/SIGSEGV (ususally cause by calling c library)
name Panic proof SIGSEGV proof
tokio (tested with xtra) Yes; thread 'tokio-runtime-worker' panicked No
bastion Yes; error with tracing No
@iacore
iacore / info.md
Created May 16, 2022 19:28
How to get alternate screen in terminal application

Use scrollback buffer

If terminal doesn't have a seperate screen buffer, but allow cursor movement, you can use new linereturn to create the new "screen", not touching the scrollback buffer above.

#############################
###### previous buffer ######
#############################
#############################
#############################
@iacore
iacore / koka.ohm
Created January 17, 2022 16:40
Koka Lex Grammar written in Ohm
Koka {
space := "\x01".."\x00" // disable builtin rules
spaces := ""
program = token*
token = whitespace | lexeme
whitespace = white | newline
newline = "\r"? "\n"
white = " " | blockcomment | linecomment | linedirective