Skip to content

Instantly share code, notes, and snippets.

View usagi's full-sized avatar
🍣
Sushi

Usagi Ito usagi

🍣
Sushi
View GitHub Profile
error[E0308]: mismatched types
-->
C:\Users\usagi\.cargo\git\checkouts\azul-f3b1e21a5e685cad\17b76b0\cargo\azul-text-layout\../../azul-text-layout\text_shaping.rs:309:73
|
309 | let error = FT_New_Memory_Face(ft_library, font_bytes.as_ptr(), buf_len, font_index as i64, &mut ft_face);
| ^^^^^^^ expected `i32`, found `i64`
|
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
309 | let error = FT_New_Memory_Face(ft_library, font_bytes.as_ptr(), buf_len.try_into().unwrap(), font_index as i64, &mut
@usagi
usagi / .rustfmt.toml
Last active February 18, 2020 04:57
usagi.network's Rust formatting rule
# https://rust-lang.github.io/rustfmt/
brace_style = "AlwaysNextLine"
combine_control_expr = false
comment_width = 127
condense_wildcard_suffixes = true
control_brace_style = "AlwaysNextLine"
empty_item_single_line = true
enum_discrim_align_threshold = 127
fn_args_layout = "Vertical"
fn_single_line = true
@usagi
usagi / layer-0.json
Last active February 22, 2020 18:05
(WiP) My Dygma Raise layers
{
"keymap": [
{
"keyCode": 53,
"label": "`"
},
{
"keyCode": 30,
"label": "1"
},
PS C:\Users\usagi\tmp\node-usb> npm install
> usb@1.6.2 install C:\Users\usagi\tmp\node-usb
> prebuild-install --verbose || node-gyp rebuild
prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info install installing standalone, skipping download.
C:\Users\usagi\tmp\node-usb>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
core.c
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\Users\usagi> cd tmp
PS C:\Users\usagi\tmp> git clone git@github.com:Dygmalab/Bazecor.git
Cloning into 'Bazecor'...
remote: Enumerating objects: 243, done.
remote: Counting objects: 100% (243/243), done.
@usagi
usagi / benchmark_vs2019.cpp
Created December 11, 2019 10:17
std::mutex vs. boost::mutex (1.71.0) vs. Windows CRITICAL_SECTION with VS2019 and Windows 10
// 以下は計測対象の仕組みを提供するヘッダー
#include <mutex>
#include <boost/thread/mutex.hpp>
#include <Windows.h>
// 以下は計測システムの実装用
#include <cmath>
#include <thread>
#include <boost/timer/timer.hpp>
#include <boost/math/constants/constants.hpp>
#include <string>
@usagi
usagi / SPAM-EMAIL-SAMPLE-2018-10-02.txt
Created October 2, 2018 03:25
The contents are bluff 100% and the From field is fake. ( And my camera devices is sealed physically with a masking tapes. lol )
Delivered-To: usagi@wonderrabbitproject.net
Received: by 2002:a1c:aca:0:0:0:0:0 with SMTP id 193-v6csp4888286wmk;
Mon, 1 Oct 2018 19:46:04 -0700 (PDT)
X-Google-Smtp-Source: ACcGV61rUxlWnyMQA0u73kIq94CiivooxgugdenyJyELaVrCn6hrYzYL7HmmFpiQV0q1au5Egao+
X-Received: by 2002:a62:1dc2:: with SMTP id d185-v6mr14131761pfd.219.1538448364069;
Mon, 01 Oct 2018 19:46:04 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1538448364; cv=none;
d=google.com; s=arc-20160816;
b=mOyb695skz3+G+5anVqa2BSh0UusAenfi1t1Rq/Ai3E9fqCmbkvY7Zl9oJfjaNEO3P
NMzeJA562fp+6yrq5Okhm4NxkVLaJOP0DKUSiC3qq23rdjyi17HmzzvMUWFdSujE3FQq
@usagi
usagi / file0.txt
Created April 6, 2017 07:54
libpng を使ったアプリが実行時に `libpng warning: Interlace handling should be turned on when using png_read_image` を吐いてくれる時の正しい対処法 ref: http://qiita.com/usagi/items/c607fb833fdd63929d33
libpng warning: Interlace handling should be turned on when using png_read_image
struct frame_type final
{
size_t get_frame_size() const
{ return sizeof( frame_type ) - 1 + data_size; }
  
some_type1 some_header1;
some_type2 some_header2;
size_t data_size = 0;
array< uint8_t, 0 > data;
};