ollamaをインストール
コマンドプロンプトからモデルをインストール
> ollama pull aya:8b
> ollama pull llama3.1:8b
Emacs mini bufferでパッケージをインストール
| $num = 3000 | |
| $range = 12 | |
| $ax = Array.new($num, 1280.0/2) | |
| $ay = Array.new($num, 800.0/2) | |
| def app_setup() | |
| App.background(App.gray(51)) | |
| end | |
| def app_update(vg, t) |
| class App | |
| def self.mouse_x | |
| Raylib.GetMouseX | |
| end | |
| def self.mouse_y | |
| Raylib.GetMouseY | |
| end | |
| def self.prev_mouse_x |
| // mruby のコードを読み込み→トップレベルの関数にアクセスするまでの手順 | |
| const char* script_path = "./code_nanovg.rb"; | |
| mrb_state* mrb; | |
| mrb_value receiver; | |
| mrb_sym app_update; | |
| mrb_state* mrb = mrb_open(); | |
| FILE* fp = fopen(script_path, "rb"); | |
| mrbc_context* context = mrbc_context_new(mrb); |
| # imgui-bindings : Yet another ImGui wrapper for Ruby | |
| # | |
| # * https://github.com/vaiorabbit/ruby-imgui | |
| # | |
| # [NOTICE] This is an automatically generated file. | |
| require 'ffi' | |
| # defines | |
| IMGUI_VERSION_NUM = 19271 # 0x4B47 |
ollamaをインストール
コマンドプロンプトからモデルをインストール
> ollama pull aya:8b
> ollama pull llama3.1:8b
Emacs mini bufferでパッケージをインストール
| require_relative '../lib/blend2d.rb' | |
| require_relative 'util' | |
| include Blend2D | |
| if __FILE__ == $PROGRAM_NAME | |
| load_blend2d_lib() | |
| img = BLImageCore.new | |
| r = blImageInitAs(img.pointer, 480, 480, BL_FORMAT_PRGB32) |
| require 'raylib' | |
| include Raylib | |
| #################################################################################################### | |
| class Game | |
| attr_reader :high_score, :config, :current_score, :state_timer | |
| STATES = [:Ready, :Playing, :GameOver] |
| /* | |
| [Usage] | |
| $ clang -I`brew --prefix mruby`/include -Iraylib/include raylib_mrb.c `brew --prefix mruby`/lib/libmruby.a raylib/lib/libraylib.a -lm -framework IOKit -framework Cocoa -framework OpenGL -o raylib_mrb | |
| $ ./raylib_mrb | |
| */ | |
| #include <mruby.h> | |
| #include <mruby/class.h> | |
| #include <mruby/compile.h> | |
| #include <mruby/data.h> | |
| #include <mruby/string.h> |
| require 'uri' | |
| google_link = ARGV[0] | |
| encoded_url = /.+url=(.+)&.+/.match(google_link)[1] | |
| decoded_url = URI.decode_www_form(encoded_url) | |
| puts decoded_url |
| require 'ffi' | |
| module UI | |
| extend FFI::Library | |
| class InitOptions < FFI::Struct | |
| layout( | |
| :Size, :size_t | |
| ) | |
| end |