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 / 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_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_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 / 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 / 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 / Dockerfile
Last active August 5, 2017 17:18
masoo/ubuntu-rbenv の source, Ubuntu 17.04 に rbenv をインストールした Dockerfile
# Pull base image.
FROM ubuntu:17.04
MAINTAINER FUNABARA Masao
# Install Ruby
RUN \
DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev nodejs && \
@masoo
masoo / font-subset.rb
Created October 4, 2014 11:37
指定ディレクトリ以下にある 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
file_string_array = content.split('')
@masoo
masoo / DateSortFilter.rb
Created April 14, 2014 00:26
jekyll Front-matter Custom attributes Sort Filter
# -*- coding: utf-8 -*-
module DateSortFilter
def date_sort_ascending(input)
input.sort {|a, b|
value = 0
left_key = a.to_liquid["date"]
right_key = b.to_liquid["date"]
if left_key.nil? && right_key.nil?
value = 0
@masoo
masoo / install_log_centos6_5_vagrant.txt
Last active August 29, 2015 13:59
CentOS 6.5 を vagrant 風にした時のログ
install_log_centos6_5_vagrant.txt
CentOS 6.5 を vagrant 風にした時のログ
## インストール
http://masoojp.blogspot.jp/2014/02/centos-65-x8664-minimal.html
## root でログイン
## ユーザーを追加
$ adduser vagrant
@masoo
masoo / rubyhighlighter.rb
Created April 5, 2014 13:21
ruby 用シンタックスハイライト
# -*- coding: utf-8 -*-
module Masoojer
require 'System'
require 'mscorlib'
require 'WindowsBase'
require 'PresentationCore'
require 'PresentationFramework'
require "Sgry.Azuki"
require "System.Drawing"