Skip to content

Instantly share code, notes, and snippets.

@adarapata
adarapata / hoge.rb
Created July 24, 2012 02:37 — forked from hiboma/hoge.rb
Quiz - Array methods
# -*- encoding: utf-8 -*-
describe Array do
let(:e) { [1,2,3,4,5] }
it "先頭の要素(1)を返すメソッド" do
e[0].should == 1
e.at(0).should == 1
e.first.should == 1
@adarapata
adarapata / gist:3301432
Created August 9, 2012 05:47
Readingtechnicalbooks0x01.homework0x03
h = {
'heteml' => 'kaba',
'muumuu' => 'kuma',
'lolipop' => 'ozisan'
}
another_hash = {
"hatena" => "cinnamon",
"oracle" => "candy",
}
public void Unko()
{
}
@adarapata
adarapata / gist:5230031
Created March 24, 2013 01:22
大分合宿自分メモ

やること

  • 玉子が点滅するリズムに合わせて、ノード玉子を発生させる

やりかた

予め16のノード玉子を生成しておく。全部非表示 玉子が光るタイミングでノード玉子をonにする

タッチされたら割る

#pragma strict
function Start () {
}
function Update () {
}
function Unko() {
print("unko");
@adarapata
adarapata / gist:5489487
Last active December 16, 2015 20:00
Capybaraでリンク属性の無い要素をクリックさせるmodule、文字列検索対応版(不完全)
# -*- coding: utf-8 -*-
module Capybara
class Session
def mouse_over(dom)
dom = convert_text_to_element(dom, "onmouseover")
execute_trigger(dom, "mouseover")
end
def mouse_click(dom)
@adarapata
adarapata / gist:5489576
Last active December 16, 2015 20:00
Capybaraでリンク属性の無い要素をクリックしたりホバーしたりするmodule
# -*- coding: utf-8 -*-
module Capybara
class Session
def mouse_over(dom)
execute_trigger(dom, "mouseover")
end
def mouse_click(dom)
execute_trigger(dom, "click")
@adarapata
adarapata / gist:5632149
Last active December 17, 2015 15:29
席替えスクリプト
using System;
using System.Collections.Generic;
class Program
{
static void Main(string[] args)
{
string[] sankisei = { "ぐっさん", "おっくん", "きたけー", "たけお"};
List<string> shuffle = new List<string>();
Ramdom r = new Random();
@adarapata
adarapata / gist:5715085
Created June 5, 2013 16:04
カーソル
/// <summary>
/// コンテンツを選択するカーソルインタフェース
/// </summary>
public interface ICursol
{
/// <summary>
/// 現在選択中のコンテンツ
/// </summary>
ICursolContent content { set; get; }
/// <summary>
@adarapata
adarapata / gist:5744196
Last active December 18, 2015 07:09
xml尻洗い図
using System.Collections;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
/// <summary>
/// クラスオブジェクトとxmlをシリアライズ・デシリアライズするクラス
/// </summary>
public static class MyXmlSerializer
{