Skip to content

Instantly share code, notes, and snippets.

View ledsun's full-sized avatar

shigeru.nakajima ledsun

View GitHub Profile
@ledsun
ledsun / gist:e1104a4e74af7cb52da26e5ac6bd43f3
Created August 19, 2023 05:25
build/wasm32-unknown-wasi/head-wasm32-unknown-wasi-full-js-debug/ext/zlib/mkmf.log
have_library: checking for deflateReset(NULL) in -lz... -------------------- no
LD_LIBRARY_PATH=.:../.. " /home/ledsun/ruby.wasm/build/toolchain/wasi-sdk/bin/clang -o conftest -I../../.ext/include/wasm32-wasi -I/home/ledsun/ruby.wasm/build/checkouts/head/include -I/home/ledsun/ruby.wasm/build/checkouts/head/ext/zlib -I/home/ledsun/ruby.wasm/build/wasm32-unknown-wasi/zlib-1.2.13/opt/usr/local/include -D_WASI_EMULATED_SIGNAL -D_WASI_EMULATED_MMAN -D_WASI_EMULATED_GETPID -D_WASI_EMULATED_PROCESS_CLOCKS -fdeclspec -O3 -fno-fast-math -g -Wall -Wextra -Wextra-tokens -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-va
@ledsun
ledsun / gist:390e798b974443005f53b0b913fb36c7
Created December 21, 2022 10:54
SWIG 3.0.12ででるsimstring gemのコンパイルエラー
compiling export_wrap.cpp
export_wrap.cpp: In function ‘void SWIG_RubyInitializeTrackings()’:
export_wrap.cpp:1263:85: error: call of overloaded ‘rb_define_virtual_variable(const char [21], VALUE (&)(...), NULL)’ is ambiguous
rb_define_virtual_variable("SWIG_TRACKINGS_COUNT", swig_ruby_trackings_count, NULL);
^
In file included from /usr/local/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from /usr/local/include/ruby-3.0.0/ruby/ruby.h:24,
from /usr/local/include/ruby-3.0.0/ruby.h:38,
from export_wrap.cpp:879:
/usr/local/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:73:1: note: candidate: ‘void ruby::backward::cxxanyargs::rb_define_virtual_variable(const char*, VALUE (*)(...), void (*)(...))’
@ledsun
ledsun / gist:d09a82dc800c5432199c23ec6fa89b6d
Created November 10, 2022 05:54
PubAnnotationでRactor#send move:true したときに起きたエラー
14:51:25 workor.1 | <OBJ_INFO:gc_mark_ptr@gc.c:6713> 0x00007fda6b47ec10 [2 M ] T_NONE
14:51:25 workor.1 | /home/ledsun/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/text_alignment-0.11.10/lib/text_alignment/anchor_finder.rb:184: [BUG] try to mark T_NONE object
14:51:25 workor.1 | ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
14:51:25 workor.1 |
14:51:25 workor.1 | -- Control frame information -----------------------------------------------
14:51:25 workor.1 | c:0020 p:---- s:0141 e:000140 CFUNC :[]
14:51:25 workor.1 | c:0019 p:0052 s:0136 e:000135 METHOD /home/ledsun/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/text_alignment-0.11.10/lib/text_alignment/anchor_finder.rb:184 [FINISH]
14:51:25 workor.1 | c:0018 p:---- s:0123 e:000122 CFUNC :call
14:51:25 workor.1 | c:0017 p:0128 s:0116 e:000115 BLOCK /home/ledsun/.rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/text_alignment-0.11.10/lib/text_alignment/anchor_finder.rb:122 [FINISH]
14:51:25 workor.1 | c:0016 p:---- s:0108 e:000107 CFUNC :
@ledsun
ledsun / gist:b76fb84feb5b6cff97a52ae2fac43d4e
Created October 6, 2022 13:18
Full execution log of rake npm:ruby-head-wasm-wasi
ledsun@MSI:~/ruby.wasm►rake npm:ruby-head-wasm-wasi 0.214s (main|💩) 22:07
npm ci
added 6 packages, and audited 7 packages in 505ms
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
WASI_VFS_CLI=build/x86_64-pc-linux-gnu/wasi-vfs-0.1.1/wasi-vfs WASMOPT=/home/ledsun/ruby.wasm/build/toolchain/binaryen/bin/wasm-opt /home/ledsun/ruby.wasm/packages/npm-packages/ruby-head-wasm-wasi/build-package.sh /home/ledsun/ruby.wasm/rubies/head-wasm32-unknown-wasi-full-js-debug
@ledsun
ledsun / gist:e0e6ae96168bedbc943a8bf96b28cb0a
Created September 28, 2022 23:58
PubAnnotationのアノテーション取り込み処理をRactor化したものをStackprofで計測したらでたエラー
obs_table" for ::1 at 2022-09-29 08:28:17 +0900
08:28:17 web.1 | Processing by JobsController#latest_gear_icon as HTML
08:28:17 web.1 | Parameters: {"project_id"=>"project1"}
08:28:17 web.1 | User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]
08:28:17 web.1 | Project Load (0.5ms) SELECT "projects".* FROM "projects" WHERE "projects"."type" IS NULL AND (accessibility = 1 OR accessibility = 3 OR user_id =1) AND "projects"."name" = $1 LIMIT $2 [["name", "project1"], ["LIMIT", 1]]
08:28:17 web.1 | ↳ app/controllers/jobs_controller.rb:105:in `set_organization'
08:28:17 web.1 | Job Load (0.4ms) SELECT "jobs".* FROM "jobs" WHERE "jobs"."organization_id" = $1 AND "jobs"."organization_type" = $2 [["organization_id", 2], ["organization_type", "Project"]]
08:28:17 web.1 | ↳ app/models/project.rb:203:in `has_unfinished_jobs?'
08:28:17 web.1 | Rendered projects/_gear_icon.html.erb (Duration: 3.4ms |
@ledsun
ledsun / index.html
Created March 18, 2022 11:19
marmaid.jsでシーケンス図を描くためのテンプレート
<html>
<body>
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
<script>mermaid.initialize({startOnLoad:true});</script>
<div class="mermaid">
sequenceDiagram
Alice->>John: Hello John, how are you?
John-->>Alice: Great!
Alice-)John: See you later!
</div>
netsh.exe interface portproxy delete v4tov4 8000
netsh.exe interface portproxy show v4tov4
pause
@ledsun
ledsun / gist:a303f1cf5edbba952b194dffa0b0180f
Created October 26, 2021 02:28
db:migrate task crash report
Dropped database 'db/development.sqlite3'
Dropped database 'db/test.sqlite3'
Created database 'db/development.sqlite3'
Created database 'db/test.sqlite3'
== 20150906120054 DeviseCreateUsers: migrating ================================
-- create_table(:users, {:id=>:integer})
-> 0.0021s
-- add_index(:users, :email, {:unique=>true})
-> 0.0009s
-- add_index(:users, :reset_password_token, {:unique=>true})
@ledsun
ledsun / IntervalNotation.js
Last active February 4, 2020 05:17
interval notationをパースするJavaScript
// Usage: new IntervalNotation('[−3,1]').test(1) => true
// What's interval notation? see: https://www.varsitytutors.com/hotmath/hotmath_help/topics/interval-notation
class IntervalNotation {
constructor(str) {
const [left, right] = str.split(',')
if (!right) {
if (left.startsWith('[') || left.startsWith('(')) {
// Upper limit is omitted
this._lowwerCond = getLowwerCond(left)
t = Thread.new {
p 'hi thread'
sleep 3
p 'bye thread'
}
fork do
p 'hi process'
t.join
p 'bye process'