Skip to content

Instantly share code, notes, and snippets.

View zbraniecki's full-sized avatar

Zibi Braniecki zbraniecki

View GitHub Profile
@zbraniecki
zbraniecki / PlatformIntlApple.cpp
Last active February 7, 2024 01:26
Hermes ICU4X
// https://github.com/facebook/hermes/blob/main/lib/Platform/Intl/PlatformIntlApple.mm#L319-L353
vm::CallResult<std::vector<std::u16string>> canonicalizeLocaleList(
vm::Runtime &runtime,
const std::vector<std::u16string> &locales) {
// 1. If locales is undefined, then
// a. Return a new empty List
// Not needed, this validation occurs closer to VM in 'normalizeLocales'.
// 2. Let seen be a new empty List.
std::vector<std::u16string> seen;
@zbraniecki
zbraniecki / sizes.txt
Last active April 17, 2023 21:21
ICU4X 1.2 Segmentation (utf16) sizes
╭────┬────────────────────────┬──────┬─────────┬────────────────╮
│ # │ name │ type │ size │ modified │
├────┼────────────────────────┼──────┼─────────┼────────────────┤
│ 0 │ ar-icu4c-line.txt │ file │ 22.7 KB │ 3 hours ago │
│ 1 │ ar-icu4c-word.txt │ file │ 48.6 KB │ 3 hours ago │
│ 2 │ ar-icu4x-line-utf8.txt │ file │ 23.8 KB │ 3 hours ago │
│ 3 │ ar-icu4x-line.txt │ file │ 22.9 KB │ 3 hours ago │
│ 4 │ ar-icu4x-word-utf8.txt │ file │ 50.5 KB │ 3 hours ago │
│ 5 │ ar-icu4x-word.txt │ file │ 48.6 KB │ 3 hours ago │
│ 6 │ ar.txt │ file │ 35.1 KB │ 3 hours ago │
@zbraniecki
zbraniecki / results.txt
Created November 2, 2022 05:51
ICU4X Result<(), _> cases
/Users/zibi/projects/icu4x〉rg 'Result<\(\)' -g "!{ffi/**}" -g "!{coverage/**}" ./ 11/02/2022 08:50:06 AM
./components/collections/src/codepointinvlist/cpinvlist.rs
864: fn test_serde_with_postcard_roundtrip() -> Result<(), postcard::Error> {
./components/collections/src/codepointtrie/cptrie.rs
996: fn test_serde_with_postcard_roundtrip() -> Result<(), postcard::Error> {
./components/list/src/provider.rs
274: ) -> Result<(), DataError> {
@zbraniecki
zbraniecki / test.js
Last active November 8, 2022 03:57
Localizable Manifest Options Size Comparison
const fs = require('fs');
const display = false;
const pretty = false;
let input = {
"title": {
"display": "Lorem Ipsum",
},
@zbraniecki
zbraniecki / structure.txt
Last active December 15, 2021 05:42
ICU4X Licenses (Dec 2021)
## Current Library Structure in the repo
//
├─ components/
│ ├─ component1/
│ │ ├─ src/
│ ├─ component2/
│ │ ├─ src/
│ │ ├─ data/
│ │ │ ├─ from_unicode/
@zbraniecki
zbraniecki / init.vim
Created November 17, 2021 15:42
nvim 0.6 config 2021-11-17
call plug#begin('~/.vim/plugged')
" Collection of common configurations for the Nvim LSP client
Plug 'neovim/nvim-lspconfig'
" Completion framework
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
" LSP completion source for nvim-cmp
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
@zbraniecki
zbraniecki / zibi.ts
Created February 1, 2021 16:41
MF2.0 Data Model
// Changed NumberLiteral to be a float+precision
// Added Variant::default
// Separated Arguments and Options on a FunctionReference
// Added KeyValuePair used in FunctionReference and maybe in MessageReference
// Added optional MessageReference if we decide to go for it
export type Message = MessageValue;
export type MessageValue = Single | Multi;
@zbraniecki
zbraniecki / datetime.cpp
Created January 25, 2021 01:07
FFI for ICU4X example
class DateTimeFormat {
public:
Result<DateTimeFormat, ()> tryNew(string aLocale, options aOptions);
string format(date aDate);
protected:
DateTimeFormat(string aLocale, ffi::DateTimeFormatData aData);
UniquePtr<ffi::DateTimeFormatData> mData;
};
@zbraniecki
zbraniecki / files.js
Created December 3, 2020 00:55
file distribution of DTD files remaining
'use strict';
const execSync = require('child_process').execSync;
const fs = require('fs');
let data = fs.readFileSync('./gh-pages/data/M1/snapshot.json');
let snapshot = JSON.parse(data);
let dtdEntities = new Set();
@zbraniecki
zbraniecki / style.css
Last active February 28, 2020 21:24
Riot Compat Dark Stylish Theme
@-moz-document url-prefix("https://chat.mozilla.org/") {
.mx_RoomTile_avatar_container img {
width: 14px;
height: 14px;
}
.mx_BaseAvatar_initial {
width: 14px !important;
height: 14px !important;
font-size: 10px !important;
line-height: 14px !important;