Skip to content

Instantly share code, notes, and snippets.

View masuidrive's full-sized avatar

Yuichiro MASUI masuidrive

View GitHub Profile
@masuidrive
masuidrive / view.rb
Created March 30, 2013 13:57
Proposal MobiRuby APIs
app.on(:resume) do
...
end
# app code
tableView = TableView.new
tableView.on(:select) do |v|
...
end
tableView.on(:cell) do |v, index|
@masuidrive
masuidrive / gist:5231110
Created March 24, 2013 08:45
clang options
OVERVIEW: LLVM 'Clang' Compiler: http://clang.llvm.org
USAGE: clang -cc1 [options] <inputs>
OPTIONS:
-### Print the commands to run for this compilation
--analyze Run the static analyzer
--migrate Run the migrator
--relocatable-pch Build a relocatable precompiled header
--serialize-diagnostics <value>
@masuidrive
masuidrive / gist:5169096
Created March 15, 2013 11:11
nodeとmrubyのissuesとcommentsの単語分布
1, this, 17544
2, that, 15950
3, have, 9742
4, with, 9584
5, http, 8688
6, node, 6024
7, should, 5743
8, error, 4285
9, test, 4209
10, work, 4175
@masuidrive
masuidrive / get_mrubysize.rb
Last active December 14, 2015 18:28
Process of bin/mruby size
#!/usr/bin/env ruby
# result
# https://docs.google.com/spreadsheet/ccc?key=0AldcEqcUVyo4dGZNOE9fTlE0YkZ2U2NTSF9jTmlJbkE&usp=sharing
require 'date'
filesizes = []
date = Date.new(2012,5,1)
while date < Date.today
@masuidrive
masuidrive / gist:5020507
Created February 23, 2013 17:13
Generate iOS Xcode project
# -*- coding: utf-8 -*-
#
require 'rubygems'
require 'xcodeproj'
FRAMEWORKS = %w{
AudioToolbox
CFNetwork
CoreGraphics
CoreLocation
@masuidrive
masuidrive / gist:4495001
Last active December 10, 2015 21:28
mruby_build.rake
class Command
def initialize(default_options = {})
...
end
def run(options, params={})
...
end
end
@masuidrive
masuidrive / build_config.rb
Last active December 10, 2015 21:18
build_configの見直し
MRuby::Build.new do |conf|
conf.bins = %w(mrbc mruby mirb)
conf.cc do |cc|
cc.command = ENV['CC'] || 'gcc'
cc.flags = (ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration))
cc.includes = []
cc.defines = %w(MRB_INT64)
cc.option_include = '-I%s'
cc.option_define = '-D%s'
@masuidrive
masuidrive / gist:4388090
Last active December 10, 2015 05:28
mruby build step proposal
sh$ CONFIG=./build_config.rb ./minirake all
----
# build_config.rb
MRuby::Build.new do |conf|
conf.cflags = '-g'
conf.ldflags = 'xxx'
conf.cc = 'clang'
@masuidrive
masuidrive / github-reporter.rb
Created November 22, 2012 15:00
JenkinsのPost build actionでgithubにコメントするスクリプト
#!/usr/bin/ruby
# require json gem. doen't support Ruby 1.8 bundled json library
#
# ex) /Users/Shared/Jenkins/Home/github-reporter.rb mobiruby mruby-cfunc "$GIT_COMMIT" "\*\*\* Passed tests \*\*\*"
require 'rubygems'
require 'yaml'
require 'github_api'
config = YAML.load(File.read(File.expand_path("~/.github.yml")))
@masuidrive
masuidrive / rubyvm1.rb
Created October 21, 2012 13:38
mruby thread proposal
# It's running on sub thread
# it isn't sharing with rubyvm_proposal1.rb's VM.
$action1_result = 0
def action1a
$action1_result
end
def action1b