Skip to content

Instantly share code, notes, and snippets.

View tosik's full-sized avatar
🏠
Working from home

Toshiyuki Hirooka tosik

🏠
Working from home
  • Tokyo, Japan
View GitHub Profile
@tosik
tosik / poker.rb
Last active August 29, 2015 13:56
module Poker
class Card
attr_accessor :number, :mark
def initialize(number, mark)
@number = number
@mark = mark
end
def number_string
新宿駅
山手線、中央線、埼京線、湘南新宿ライン、中央総武線、京王線、京王新線、都営新宿線、大江戸線、丸ノ内線、小田急小田原線
新宿三丁目駅
都営新宿線、丸ノ内線、副都心線、
代々木駅
中央総武線、山手線、大江戸線
南新宿駅
public class Application extends Sprite
{
public function Apllication()
{
var context:Context = new Context()
.install(MVCSBundle)
.configure(MainConfig)
.configure(ContextView(this))
context.initialize();
}
@tosik
tosik / main.c
Created March 17, 2014 02:37
iOS 用 mruby XCode ライブラリ "MRuby.framework" を作る簡単な方法 ref: http://qiita.com/tosik/items/73c4253d132ebe610240
#include <MRuby/mruby.h>
#include <Mruby/mruby/proc.h>
@tosik
tosik / mrb_objc.mm
Created March 18, 2014 03:15
mruby on iOS 導入部分メモ
mrb = mrb_open();
NSString * bcfile = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"context.mrb"];
NSFileHandle * fileHandle = [NSFileHandle fileHandleForReadingAtPath:bcfile];
NSData * data = [fileHandle readDataToEndOfFile];
uint8_t * bytes = (uint8_t *)malloc([data length]);
memcpy(bytes, [data bytes], [data length]);
[fileHandle closeFile];
mrb_load_irep(mrb, bytes);
@tosik
tosik / gist:9616445
Created March 18, 2014 09:18
homebrew でインストールした jenkins の再起動
$ launchctl list | grep jenkins
28201 - homebrew.mxcl.jenkins
$ launchctl stop homebrew.mxcl.jenkins
$ launchctl list | grep jenkins
- 143 homebrew.mxcl.jenkins
$ launchctl start homebrew.mxcl.jenkins
$ launchctl list | grep jenkins
16812 - homebrew.mxcl.jenkins
class Bar
end
foo = Time.now.to_s #=> "2014-05-14 15:35:01 +0900"
bar = Time.now.to_s #=> "2014-05-14 15:35:32 +0900"
foo == bar #=> false
@tosik
tosik / gist:15b4452f2837bddbb5d2
Created September 17, 2014 10:50
docker mysql runner
docker run --name mysql -d sameersbn/mysql:latest
defmodule Foo do
def loop do
receive do
{:hello, msg} ->
IO.puts msg
loop
{:world, _} ->
IO.puts "bad"
loop
end