This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'shellwords' | |
end | |
CHATGPT_URI = "https://chat.openai.com/chat" | |
def get_page_info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// style-1 | |
scanner->sis = grn_scan_info_build(ctx, | |
scanner->expr, | |
&(scanner->n_sis), | |
op, | |
record_exist); | |
// style-2 | |
scanner->sis = | |
grn_scan_info_build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.<collections>.aggregate({$indexStats:{}})._batch.reduce((h,i) => {h[i.spec.name] = i.accesses.ops; return h}, {}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "em-synchrony" | |
def foo | |
fiber = Fiber.current | |
EM::Timer.new 3 do | |
fiber.resume "foo" | |
end | |
Fiber.yield | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% time seconds usecs/call calls errors syscall | |
------ ----------- ----------- --------- --------- ---------------- | |
26.90 0.257079 6 41582 rt_sigprocmask | |
16.05 0.153354 7 20767 write | |
14.84 0.141774 7 20773 getsockopt | |
13.86 0.132456 6 20768 sched_yield | |
13.30 0.127114 18 6885 select | |
9.32 0.089066 6 13834 clock_gettime | |
5.53 0.052820 8 6986 50 read | |
0.09 0.000887 29 31 writev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# grndb check /data/groonga/production | |
[query_log_flags_get] Can't open object. It's broken. Re-create the object or the database. | |
[query_log_flags_set] Can't open object. It's broken. Re-create the object or the database. | |
[query_log_flags_add] Can't open object. It's broken. Re-create the object or the database. | |
[query_log_flags_remove] Can't open object. It's broken. Re-create the object or the database. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
while [ "`echo $1 | cut -c1`" = "-" ]; do | |
OPT="$OPT $1" | |
shift | |
done | |
IMG_TAG=`echo $1 | awk -F\@ '{print $1}'` | |
CMD=`echo $1 | awk -F\@ '{print $2}'` | |
IMG=`echo $IMG_TAG | awk -F: '{print $1}'` | |
TAG=`echo $IMG_TAG | awk -F: '{print $2}'` | |
if [ -z "$CMD" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"sync" | |
) | |
type LogLevel int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 __lll_lock_wait_private () | |
at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95 | |
#1 0x00007f07b472e67a in __GI___libc_malloc (bytes=139671072336672) | |
at malloc.c:2909 | |
#2 0x00007f07b4f10567 in ?? () from target:/lib64/ld-linux-x86-64.so.2 | |
#3 0x00007f07b4f17412 in ?? () from target:/lib64/ld-linux-x86-64.so.2 | |
#4 0x00007f07b4f12394 in ?? () from target:/lib64/ld-linux-x86-64.so.2 | |
#5 0x00007f07b4f16bd9 in ?? () from target:/lib64/ld-linux-x86-64.so.2 | |
#6 0x00007f07b47ed9bd in do_dlopen (ptr=0x161f640) at dl-libc.c:87 | |
#7 0x00007f07b4f12394 in ?? () from target:/lib64/ld-linux-x86-64.so.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** Error in `ruby2.3': free(): invalid pointer: 0x000000000415b9f0 *** | |
======= Backtrace: ========= | |
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fe58e2da7e5] | |
/lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7fe58e2e2e0a] | |
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fe58e2e698c] | |
/usr/lib/x86_64-linux-gnu/libruby-2.3.so.2.3(+0x8fcfd)[0x7fe58e6bbcfd] |