Skip to content

Instantly share code, notes, and snippets.

@iacore
iacore / mod.rs
Created March 30, 2023 05:50
opencolor for femtovg
pub use inner::*;
#[rustfmt::skip]
mod inner {
use femtovg::Color;
use lazy_static::lazy_static;
lazy_static!{ pub static ref WHITE: Color = Color::rgb(0xff, 0xff, 0xff); }
lazy_static!{ pub static ref BLACK: Color = Color::rgb(0x00, 0x00, 0x00); }
lazy_static!{ pub static ref GRAY_0: Color = Color::rgb(0xf8, 0xf9, 0xfa); }
@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