- .irbrcに設定する
- ヒストリと補完は必ず動くようにする(複数行編集とかもできるようになるのでRuby 2.7以降がおすすめ)
require 'irb/ext/save-history'
require 'irb/completion'
require 'caseninja'
require 'open-uri'
// add | |
location.href="textwell:///add?text="+encodeURIComponent("["+document.title+" "+location.href+"]") | |
// insert | |
location.href="textwell:///insert?text="+encodeURIComponent("["+document.title+" "+location.href+"]") |
c = T.current; | |
if(c){ | |
s = "[" + c + "]" | |
if(T.range.len){ | |
T("replaceRange", {text:s, | |
replacingRange:{ loc:T.range.loc, len:c.length }, | |
selectingRange:{ loc:T.range.loc, len:s.length } | |
} ); | |
}else{ | |
T("replaceCurrent",{text:s}); |
c = T.current; | |
if(c){ | |
s = "[*** " + c + "]" | |
if(T.range.len){ | |
T("replaceRange", {text:s, | |
replacingRange:{ loc:T.range.loc, len:c.length }, | |
selectingRange:{ loc:T.range.loc, len:s.length } | |
} ); | |
}else{ | |
T("replaceCurrent",{text:s}); |
require 'irb/ext/save-history'
require 'irb/completion'
require 'caseninja'
require 'open-uri'
def get_recent_tracks(token) | |
URI.open("https://api.spotify.com/v1/me/player/recently-played", "Authorization" => "Bearer #{token}") do |f| | |
JSON.load(f.read)["items"].map do |e| | |
e = e["track"] | |
"#{e["name"]} - #{e["artists"][0]["name"]}" | |
end | |
end | |
end | |
TOKEN = 'XXXXXXXXXX' |
# include <Siv3D.hpp> | |
// アニメーション描画用のクラス | |
struct AnimationTexture | |
{ | |
Array<Texture> textures; | |
// フレームの時間 | |
Array<int32> delays; | |
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"😂")), | |
}; |