Skip to content

Instantly share code, notes, and snippets.

@hkdnet
hkdnet / config.ru
Last active October 28, 2019 06:27
require 'rack'
require 'rack/lobster'
class Streaming
class Stream
def each
%w[a b c].each do |e|
puts "Stream#each with #{e}"
sleep 1
yield e
diff --git a/struct.c b/struct.c
index ceb025ff83..6fc489e3a2 100644
--- a/struct.c
+++ b/struct.c
@@ -1401,6 +1401,8 @@ InitVM_Struct(void)
rb_undef_alloc_func(rb_cStruct);
rb_define_singleton_method(rb_cStruct, "new", rb_struct_s_def, -1);
+ rb_define_singleton_method(rb_cStruct, "keyword_init?", rb_struct_s_keyword_init, 0);
+
@hkdnet
hkdnet / kick-and-wait.sh
Created July 5, 2021 00:58
Kick and wait CircleCI WF
#!/bin/bash -eux
set -o pipefail
org=$1
repo=$2
branch=$3
get_status() {
curl -fs --retry 3 -X GET -u ${CIRCLE_TOKEN}: \
--url "https://circleci.com/api/v2/pipeline/$1/workflow"