This file contains 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 'net/https' | |
http = Net::HTTP.new("example.com", 443) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
store = OpenSSL::X509::Store.new | |
store.set_default_paths | |
http.cert_store = store | |
# For Windows, use Net::HTTP#ca_file= instead of the above three lines as follows: | |
# http.ca_file = "/path/to/cacert.pem" | |
# Root certificates are available at http://curl.haxx.se/ca/cacert.pem |
This file contains 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
# before | |
def balance(*args) | |
case args | |
in [RedFork[a, xk, xv, b], yk, yv, RedFork[c, zk, zv, d]] | |
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]] | |
in [RedFork[RedFork[a, xk, xv, b], yk, yv, c], zk, zv, d] | |
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]] | |
in [RedFork[a, xk, xv, RedFork[b, yk, yv, c]], zk, zv, d] | |
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]] | |
in [a, xk, xv, RedFork[b, yk, yv, RedFork[c, zk, zv, d]]] |
This file contains 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
eval$s= | |
%w(e="e val$s=% w("+$s+")*'' ";a=0;" | |
>KIZOaz(( *EHO1M< nz[MPb.~qirzBv0n'q T;lIup | |
oz6kZqF3{G pD+PSaA F1zJEw/,kBa>3f H_/D7+pAYH'O>NQ$g=JH6 E=C|Di | |
&~<2lBiHLV=r k+KjOcz )Bb~qVa1X)G2`[tb,& ".bytes {a=a*9 1+_1%9 | |
2-1};$ ><<"\e [2J";d= (1..7). map{"\e [3#{_1 | |
}m"};3 20.times{|k|h ="\e[1;1H";b=0;(0 ...10). each{| | |
v|h<<3 2.chr*(Math .sin(k /99.0) .abs*(10 -v));89 .time | |
s{h<<d [k*7/320, 3].samp le;h<<(a [v*89+_1]==1?(c=e[b] ;b+=1 | |
;c):32) };h<<10} ;$><<h+"\e[ 0m";sl eep(0.01)};2001- 2023)*'' |
This file contains 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
=============================================== | |
PRK Firmware 0.9.20 (20230419 revision 21c7662) | |
PICORUBY_NO_MSC: false | |
prk-conf: :: | |
=============================================== | |
STATS 92032/204800 | |
Init Keyboard | |
Init GPIO | |
Configured as a split-type Anchor |
This file contains 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
kbd = Keyboard.new | |
kbd.split = true | |
kbd.init_pins( | |
[ 4, 5, 6, 7, 8 ], | |
[ 28, 27, 26, 22, 20, 23, 21 ] | |
) | |
kbd.add_layer :default, %i[ |
This file contains 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 | |
export PATH="/bin:/usr/bin:/sbin:/usr/sbin" | |
if on_ac_power; then | |
powerprofilesctl set performance | |
else | |
powerprofilesctl set power-saver | |
fi |
This file contains 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
<html> | |
<script src="https://cdn.jsdelivr.net/npm/ruby-head-wasm-wasi@0.5.0/dist/browser.script.iife.js"></script> | |
<button id="start">Start</button> | |
<div id="counter">0</div> | |
<script type="text/ruby"> | |
require "js" | |
def start_counter |
This file contains 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
<html> | |
<script src="https://cdn.jsdelivr.net/npm/ruby-head-wasm-wasi@0.5.0/dist/browser.script.iife.js"></script> | |
<script type="text/ruby"> | |
require "js" | |
document = JS.global[:document] | |
window = JS.global[:window] | |
start = document.getElementById("start") | |
counter = document.getElementById("counter") |
This file contains 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
$ cat b2.rb | |
require 'forwardable' | |
require 'pp' | |
require 'benchmark/ips' | |
class Obj | |
extend Forwardable | |
attr_accessor :other |
This file contains 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
diff --git a/extlib/coru/coru_platform.c b/extlib/coru/coru_platform.c | |
index fb64002..bab7041 100644 | |
--- a/extlib/coru/coru_platform.c | |
+++ b/extlib/coru/coru_platform.c | |
@@ -68,8 +68,8 @@ __asm__ ( | |
// we startup a coroutine. | |
void coru_plat_prologue(void); | |
__asm__ ( | |
- ".globl coru_plat_prologue \n" | |
- "coru_plat_prologue: \n" |
NewerOlder