Skip to content

Instantly share code, notes, and snippets.

View vaiorabbit's full-sized avatar
🎮
busy playing video games

vaiorabbit

🎮
busy playing video games
View GitHub Profile
@vaiorabbit
vaiorabbit / 06_bump.rb
Created May 31, 2020 04:02
06_bump.rb : Ruby-bgfx port of 'cubes.cpp' (WIP). Ref.: https://gist.github.com/vaiorabbit/29acb4ff3b94cefdbcfac3e2787eef50
#
# Ref.: bgfx/examples/06-bump/bump.cpp
# https://github.com/vaiorabbit/ruby-opengl/tree/master/sample
#
require 'rmath3d/rmath3d'
require 'opengl'
require 'glfw'
require_relative '../../bindings/ruby/bgfx.rb'
require_relative './utils.rb'
@vaiorabbit
vaiorabbit / 01_cubes.rb
Last active May 30, 2020 09:43
01_cubes.rb : Ruby-bgfx port of 'cubes.cpp' (WIP). Ref.: https://gist.github.com/vaiorabbit/29acb4ff3b94cefdbcfac3e2787eef50
#
# Ref.: bgfx/examples/01-cubes/cubes.cpp
# https://github.com/vaiorabbit/ruby-opengl/tree/master/sample
#
require 'rmath3d/rmath3d'
require 'opengl'
require 'glfw'
require_relative '../../bindings/ruby/bgfx.rb'
require_relative './logo.rb'
@vaiorabbit
vaiorabbit / 00_helloworld.rb
Last active May 24, 2020 10:46
00_helloworld.rb : Ruby-Bgfx port of 'helloworld.cpp' (WIP). Ref.: https://gist.github.com/vaiorabbit/29acb4ff3b94cefdbcfac3e2787eef50
#
# Ref.: bgfx/examples/00-helloworld/helloworld.cpp
# https://github.com/vaiorabbit/ruby-opengl/tree/master/sample
#
require 'opengl'
require 'glfw'
require_relative '../bindings/ruby/bgfx.rb'
require_relative './logo.rb'
OpenGL.load_lib()
@vaiorabbit
vaiorabbit / bgfx.rb
Last active May 30, 2020 07:42
WIP: bgfx.rb
require 'ffi'
#
# Typedefs
#
FFI.typedef :uint16, :Bgfx_view_id_t # [HACK] Hard-coded. Seems we can't get information about this from current 'bgfx.idl'.
FFI.typedef :int, :Bgfx_fatal_t
@vaiorabbit
vaiorabbit / launch.json
Last active February 17, 2022 07:59
VSCode settings for ruby debugging
{
// IntelliSense を使用して利用可能な属性を学べます。
// 既存の属性の説明をホバーして表示します。
// 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Debug Local File",
"type": "Ruby",
"request": "launch",
@vaiorabbit
vaiorabbit / destroy_like.rb
Created April 8, 2020 15:24
Twitter 'POST favorites/destroy' API
#! /usr/bin/env ruby
# coding: utf-8
# Usage:
# - Set environment variables 'TWITTER_CONSUMER_KEY', 'TWITTER_CONSUMER_SECRET', 'TWITTER_ACCESS_TOKEN' and 'TWITTER_ACCESS_TOKEN_SECRET' beforehand
# - $ ruby destroy_like.rb [tweet id]
# Ref.: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-favorites-destroy
require 'json'
@vaiorabbit
vaiorabbit / launch.json
Created January 2, 2020 05:50
tasks.json and launch.json for debugging Go program with stdin interaction
// Ref.: https://github.com/Microsoft/vscode-go/issues/219#issuecomment-449621513
{
"version": "0.2.0",
"configurations": [
/* Configuration for normal debugging
{
"name": "Launch",
"type": "go",
"request": "launch",
"mode": "auto",
@vaiorabbit
vaiorabbit / SequenceDiagram3.plantuml
Created June 11, 2019 15:24
UMLモデリングのエッセンス 第3版 図4.4
@startuml
hide footbox
participant ":Order" as O
participant "careful : Distributor" as CD
participant "regular : Distributor" as RD
participant ":Messenger" as M
/' skinparam lifelineStrategy solid '/
skinparam lifelineStrategy dashed
@vaiorabbit
vaiorabbit / SequenceDiagram2.plantuml
Created June 10, 2019 14:57
UMLモデリングのエッセンス 第3版 図4.3
@startuml
hide footbox
participant "a Handler" as H
participant "a Query Command" as QC
participant "a Database Statement" as DS
/' skinparam lifelineStrategy solid '/
skinparam lifelineStrategy dashed
@vaiorabbit
vaiorabbit / SequenceDiagram.plantuml
Created June 10, 2019 14:18
UMLモデリングのエッセンス 第3版 図4.1
@startuml
hide footbox
participant "an Order"
participant "an Order Line"
participant "aProduct"
participant "aCustomer"
[o-> "an Order" : calculatePrice
activate "an Order"