Skip to content

Instantly share code, notes, and snippets.

@ytomino
ytomino / .gitignore
Created April 9, 2012 06:46
Boost.Context in Ada
# This gist contains Ada version of Boost.Context and test.
/asm
/build
/b~*
/*.o
/import
/test_context
@ytomino
ytomino / romantable_jisx6004.txt
Last active October 11, 2023 14:42
JIS-X-6004 for Google日本語入力
- -
-- ―
―- ― ―
~ ~
・< ・・
・・< …
・- ←
さ- ↓
^- ↑
-> →
@ytomino
ytomino / jp.halfmoon.panathenaia.pip.yml
Last active April 10, 2023 17:08
Close the application fetched with pip into flatpak.
app-id: jp.halfmoon.panathenaia.pip
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
#sdk-extensions:
build-options:
build-args:
- --filesystem=/var/tmp
- --share=network
strip: false
@ytomino
ytomino / nim.plist
Last active November 18, 2022 15:48
Nim language module for BBEdit/TextWrangler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BBEditDocumentType</key>
<string>CodelessLanguageModule</string>
<key>BBLMLanguageCode</key>
<string>Nim</string>
<key>BBLMLanguageDisplayName</key>
<string>Nim</string>
@ytomino
ytomino / urlsort.ml
Last active April 18, 2022 19:03
Sorting URLs
let split_domain = String.split_on_char '.';;
let url_re =
Str.regexp "^\\([^:]*://\\)?\\([^/]*\\)\\(/[^?]*\\)?\\(\\?.*\\)?$";;
let split_url x =
let protocol, domain, path, query =
if Str.string_match url_re x 0 then (
let protocol = try Str.matched_group 1 x with Not_found -> "" in
let domain = Str.matched_group 2 x in
@ytomino
ytomino / c-bits-byteswap.adb
Last active March 17, 2022 18:34
zlib in x86_64-linux-gnu
-- This file is translated by "headmaster" version 0.31-1157199 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
package body C.bits.byteswap is
function bswap_32 (bsx : unsigned_int) return unsigned_int is
begin
return builtin_bswap32 (bsx);
end bswap_32;
@ytomino
ytomino / c-asm_generic-errno.ads
Last active March 17, 2022 07:15
iconv (glibc) in x86_64-linux-gnu
-- This file is translated by "headmaster" version 0.31-1157199 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
package C.asm_generic.errno is
pragma Preelaborate;
EADDRINUSE : constant := 98;
EADDRNOTAVAIL : constant := 99;
EADV : constant := 68;
@ytomino
ytomino / c-alloca.ads
Last active March 17, 2022 03:37
GMP, MPFR, and MPC in x86_64-linux-gnu
-- This file is translated by "headmaster" version 0.31-1157199 (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
with C.stddef;
package C.alloca is
pragma Preelaborate;
function alloca (size : stddef.size_t) return void_ptr;
pragma Import (C, alloca, "alloca");
@ytomino
ytomino / terror.py
Last active January 12, 2022 22:21
The reformatter for compiler's error messsages
#!/usr/bin/env python3
import fnmatch
import os
import re
import sys
msgtype = "gcc"
rootdir = os.getcwd()
workdir = rootdir
@ytomino
ytomino / c-bits-byteswap.adb
Last active August 10, 2021 04:25
OpenSSL in x86_64-linux-gnu
-- This file is translated by "headmaster" version 0.30-e83b81d (devel).
-- The original C header's license should be applied to this file.
-- All conditional-directives are expanded for the exclusive use of your
-- environment, it is not recommended to commit this file to any repository.
-------------------------------------------------------------------------------
package body C.bits.byteswap is
function bswap_32 (bsx : unsigned_int) return unsigned_int is
begin
return builtin_bswap32 (bsx);
end bswap_32;