Skip to content

Instantly share code, notes, and snippets.

@ongaeshi
ongaeshi / gist:e1feb30f0a9701ab5183b2d4e55ddd1c
Last active December 14, 2020 15:31
bundle exec steep langserver がWindows上で失敗する
PS C:\Users\ongaeshi\Documents\ruby3-test> bundle exec steep langserver
#<ArgumentError: wrong exec option symbol: pgroup>
C:/Ruby30-x64/lib/ruby/3.0.0/open3.rb:221:in `spawn'
C:/Ruby30-x64/lib/ruby/3.0.0/open3.rb:221:in `popen_run'
C:/Ruby30-x64/lib/ruby/3.0.0/open3.rb:160:in `popen2'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/steep-0.38.0/lib/steep/server/worker_process.rb:32:in `spawn_worker'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/steep-0.38.0/lib/steep/drivers/langserver.rb:43:in `run'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/steep-0.38.0/lib/steep/cli.rb:153:in `process_langserver'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/steep-0.38.0/lib/steep/cli.rb:50:in `run'
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/steep-0.38.0/exe/steep:11:in `<top (required)>'
# coding: utf-8
require "radiko/radiko"
include Radiko
def c(channel, wday)
Radiko::Radiko.new(channel, last_wday(wday + 1, 1, 0)).astr(channel)
end
def ann(title, wday)
print title, "\n",
#include <Siv3D.hpp> // OpenSiv3D v0.4.3
#include <mruby.h>
#include "mruby/array.h"
#include <mruby/compile.h>
#include <mruby/dump.h>
#include <mruby/string.h>
extern "C" void siv3d_Print(const char* str)
{
# include <Siv3D.hpp> // OpenSiv3D v0.4.3
void Main()
{
const std::array<Texture, 3> textures =
{
Texture(Emoji(U"😊")),
Texture(Emoji(U"😒")),
Texture(Emoji(U"😂")),
};
script do
(1..360).each do |e|
radian = 32
rad = e * (Math::PI * 2) / 360
0.upto(6) do |y|
y *= 100
circfill(Window.center.x, y, radian * Math::sin(rad), [Math::sin(rad) * 127 + 128, 64, 64])
circfill(Window.center.x + 100, y, radian * Math::cos(rad), [64, Math::cos(rad) * 127 + 128, 64])
circfill(Window.center.x - 100, y, radian * Math::cos(rad), [64, 64, Math::cos(rad) * 127 + 128])
end
@ongaeshi
ongaeshi / foo.rb
Last active August 7, 2019 14:09
mruby 2.0.1 with mruby-require
class Foo
end
@ongaeshi
ongaeshi / sample.md
Last active February 28, 2019 15:23
モバイルでも書きやすいMarkdwon風のプログラム言語
  • mobcode
  • mobgram
  • minimo
  • pico
  • picoco
  • marimo

Rubyへのトラスレーターとして実装する
Rubyに変換できればOpal経由でJSでも実行できる

@ongaeshi
ongaeshi / length.rb
Last active February 19, 2019 15:48
s.length * 1000
void Main()
{
Window::Resize(640, 640);
double t = 0.0;
while (System::Update()) {
t += System::DeltaTime() * 0.2;
for (int32 i = 0; i < 9; i++) {
const Vec2 center(120 + i % 3 * 200, 120 + i / 3 * 200);
font = Font.new(30)
camera = Camera2D.new
while System.update do
camera.update
camera.transform do
font["Camera2D Test"].draw_at(320, 200)
Circle.new(320, 240, 50).draw([255, 0, 0, 127])
end