Skip to content

Instantly share code, notes, and snippets.

Avatar

vaiorabbit

View GitHub Profile
View 06_bump_sdl2_metal.rb
# coding: utf-8
#
# Ref.: bgfx/examples/06-bump/bump.cpp
# https://github.com/vaiorabbit/sdl2-bindings
#
require 'rmath3d/rmath3d'
require 'sdl2'
require_relative '../../bindings/ruby/bgfx.rb'
require_relative './logo.rb'
require_relative './utils.rb'
View 06_bump_imgui.rb
# coding: utf-8
#
# 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'
View 06_bump.rb
#
# 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
01_cubes.rb : Ruby-bgfx port of 'cubes.cpp' (WIP). Ref.: https://gist.github.com/vaiorabbit/29acb4ff3b94cefdbcfac3e2787eef50
View 01_cubes.rb
#
# 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
00_helloworld.rb : Ruby-Bgfx port of 'helloworld.cpp' (WIP). Ref.: https://gist.github.com/vaiorabbit/29acb4ff3b94cefdbcfac3e2787eef50
View 00_helloworld.rb
#
# 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
WIP: bgfx.rb
View 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 Apr 19, 2020
VSCode settings for ruby debugging
View launch.json
{
// 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 Apr 8, 2020
Twitter 'POST favorites/destroy' API
View destroy_like.rb
#! /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 Jan 2, 2020
tasks.json and launch.json for debugging Go program with stdin interaction
View launch.json
// 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 Jun 11, 2019
UMLモデリングのエッセンス 第3版 図4.4
View SequenceDiagram3.plantuml
@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
You can’t perform that action at this time.