Skip to content

Instantly share code, notes, and snippets.

Issue = Struct.new(:id, :name)
Note = Struct.new(:id, :issue_id, :name)
issue1 = Issue.new(1, "aaa")
issue2 = Issue.new(2, "bbb")
note1_1 = Note.new(1, 1, "note1-1")
note1_2 = Note.new(2, 1, "note1-2")
note2_1 = Note.new(3, 2, "note2-1")
@miyohide
miyohide / mruby_esp32_temp.txt
Created September 28, 2017 12:49
mruby esp32 temp result
[~/work/mruby-esp32]$ make MRUBY_EXAMPLE=adt7410_mrb.rb flash monitor *[add_i2c][2.3.3]
(in /Users/miyohide/work/mruby-esp32/components/mruby_component/mruby)
Build summary:
================================================
Config Name: host
Output Directory: build/host
Binaries: mrbc
Included Gems:
@miyohide
miyohide / mruby_esp32_hello_mruby_world.txt
Created September 28, 2017 12:25
mruby esp32 Hello mruby world!
[~/work/mruby-esp32]$ make MRUBY_EXAMPLE=simplest_mrb.rb flash monitor *[add_gps][2.3.3]
(in /Users/miyohide/work/mruby-esp32/components/mruby_component/mruby)
Build summary:
================================================
Config Name: host
Output Directory: build/host
Binaries: mrbc
Included Gems:
@miyohide
miyohide / gist:03f53094f4be80d26ff32a8216da74be
Created September 27, 2017 12:43
mruby C lang output sample.
[~/work/mruby-1.3.0]$ cat hello_mruby_world.rb [2.3.3]
100.times do
puts 'Hello mruby World!'
end
[~/work/mruby-1.3.0]$ bin/mrbc -B out hello_mruby_world.rb [2.3.3]
[~/work/mruby-1.3.0]$ cat hello_mruby_world.c [2.3.3]
/* dumped in little endian order.
use `mrbc -E` option for big endian CPU. */
#include <stdint.h>
Leaving...
Hard resetting...
MONITOR
--- idf_monitor on /dev/cu.SLAB_USBtoUART 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
s = "'aaaa', 'bbb', 'ccc,ddd'"
s.scan(/['"](?:[^'\"])*['"]/) # => ["'aaaa'", "'bbb'", "'ccc,ddd'"]
@miyohide
miyohide / get_info_from_amazon.rb
Created June 28, 2017 11:57
Amazonの商品データをrpaproxy経由で取ってくるサンプル
require 'net/http'
require 'uri'
require 'timeout'
AMAZON_ECS_URL='http://rpaproxy.tdiary.org/rpaproxy/jp/'
SUBSCRIPTION_ID='xxxxxxxxxxxxxxxxxxxxxxxxxx'
API_VERSION='2007-01-17'
def amazon_fetch(url, limit = 10)
raise ArgumentError, 'HTTP redirect too deep' if limit == 0
function Codefy() range
let start_pos = a:firstline - 1
let end_pos = a:lastline
call append(end_pos, split("```\n", "", 1))
call append(start_pos, split("\n```ruby", "", 1))
endfunction
#!/bin/bash
# ----------------------
# KUDU Deployment Script
# Version: 1.0.6
# ----------------------
# Helpers
# -------