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
| =============================================== | |
| 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 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
| 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 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 | |
| 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 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
| <html> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/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 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
| <html> | |
| <script src="https://cdn.jsdelivr.net/npm/[email protected]/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 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
| $ cat b2.rb | |
| require 'forwardable' | |
| require 'pp' | |
| require 'benchmark/ips' | |
| class Obj | |
| extend Forwardable | |
| attr_accessor :other |
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
| 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" |
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
| excelsior:test$ ./cobench | |
| [0x10b4e3600] measuring co_create+co_delete performance ... | |
| [0x10b4e3600] 0.186263 usec | |
| [0x10b4e3600] measuring switch performance ... | |
| zsh: segmentation fault ./cobench |
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
| excelsior:perfume$ cat t.prfm | |
| set c [coro { | |
| println "1st step"; | |
| pause; | |
| println "2nd step"; | |
| }]; | |
| $c next; # → "1st step" | |
| $c next; # → "2nd step" | |
| $c release; | |
| excelsior:perfume$ perfumesh t.prfm |
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
| def evaluate(expr) | |
| case expr | |
| in ["value", x] | |
| x | |
| in ["+", x, y] | |
| evaluate(x) + evaluate(y) | |
| in ["-", x, y] | |
| evaluate(x) - evaluate(y) | |
| in ["*", x, y] | |
| evaluate(x) * evaluate(y) |