Skip to content

Instantly share code, notes, and snippets.

View masoo's full-sized avatar
🐔
In the chicken

FUNABARA Masao masoo

🐔
In the chicken
View GitHub Profile
@masoo
masoo / Dockerfile
Last active August 6, 2017 07:25
Ubuntu 17.04 -> rbenv -> ruby 2.4.1 をインストールした Dockerfile
FROM masoo/ubuntu-rbenv:3.0
MAINTAINER FUNABARA Masao
RUN \
cd ~/.rbenv && \
git pull origin master && \
cd ~/.rbenv/plugins/ruby-build && \
git pull origin master && \
cd ~/.rbenv/plugins/rbenv-gem-rehash && \
@masoo
masoo / font-subset.rb
Created February 29, 2016 04:57
フォルダ内の .html ファイルの文字一覧を出力するスクリプト
# coding: utf-8
require 'find'
target_dir = ARGV[0]
all_string = []
Find.find(target_dir) do |file|
if File.extname(file) == ".html"
content = File.open(file).read
@masoo
masoo / ruby-csharp_script_sample001.rb
Created July 15, 2016 14:21
ruby-csharp_script sample #1
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
#r "System"
using System;
for (int i=0; i<10; i++) {
Console.WriteLine(i.ToString(" 0"));
}
@masoo
masoo / ruby-csharp_script_sample002.rb
Created July 15, 2016 14:23
ruby-csharp_script sample #2
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
#r "PresentationFramework"
using System;
using System.Windows;
var result = MessageBox.Show(
@masoo
masoo / ruby-csharp_script_sample003.rb
Created July 15, 2016 14:24
ruby-csharp_script sample #3
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
#r "PresentationFramework "
using System;
using System.Windows;
using System.Windows.Controls;
@masoo
masoo / ruby-csharp_script_sample004.rb
Created July 15, 2016 14:26
ruby-csharp_script sample #4
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
1
EOS
result = csharp_script.EvaluateAsync(code)
p result
@masoo
masoo / ruby-csharp_script_sample005.rb
Created July 15, 2016 14:27
ruby-csharp_script sample #5
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
10.08
EOS
result = csharp_script.EvaluateAsync(code)
p result
@masoo
masoo / ruby-csharp_script_sample006.rb
Created July 15, 2016 14:28
ruby-csharp_script sample #6
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
"Hello, Ruby!"
EOS
result = csharp_script.EvaluateAsync(code)
p result
@masoo
masoo / ruby-csharp_script_sample007.rb
Created July 15, 2016 14:29
ruby-csharp_script sample #7
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
new int[] { 1, 3, 5, 7, 9 }
EOS
result = csharp_script.EvaluateAsync(code)
p result
@masoo
masoo / ruby-csharp_script_sample008.rb
Created July 15, 2016 14:30
ruby-csharp_script sample #8
require 'pp'
require 'win32ole'
csharp_script = WIN32OLE.new('ruby.csharp_script.CsharpScript')
code = <<"EOS"
class Sample
{
public int x;