Skip to content

Instantly share code, notes, and snippets.

View kaakaa's full-sized avatar
🚼

Yusuke Nemoto kaakaa

🚼
View GitHub Profile
@kaakaa
kaakaa / EnglishNumerals.rb
Created June 4, 2012 13:12
みなとRuby会議01 ソーシャルコーディング EnglishNumerals
# -*- encoding: UTF-8 -*-
input = ARGV[0].to_i
array = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
array2 = ['','hoge', 'twenty', 'thirty', 'fourty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']
array2_1 = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']
def hundred(number)
return number + ' hundred'
@kaakaa
kaakaa / CreateAmidakuji.java
Created June 5, 2012 14:08
みなとRuby会議01 ソーシャルコーディング あみだくじ
package org.yokohama.rb.kaigi01;
import org.yokohama.rb.kaigi01.result.ResultViewModel;
public class CreateAmidakuji {
public CreateAmidakuji() {
ResultViewModel model = new ResultViewModel(5);
System.out.println(model.toString());
}
@kaakaa
kaakaa / matrix.groovy
Created October 21, 2012 21:50
matrix.groovy
List<Record> recordList = new ArrayList<Record>()
recordList.add(new Record().build("A1","B1","C1"))
recordList.add(new Record().build("A2","B2","C2"))
recordList.add(new Record().build("A3","B3","C3"))
recordNames = ["factorA","factorB","factorC"]
List<Column> columnList = new ArrayList<Column>()
def file = // as File
file.eachLine{
println it
}
file.splitEachLine(','){ data ->
println '0th data =>' + data[0]
println data[1..-1]
}
configurations{ iso }
dependencies{
iso fileTree(dir: 'lib', includes: ['*.jar'])
}
task iso << {
ant.taskdef(name: 'makeiso', classpath: configurations.iso.asPath, classname:'de.tu_darmstadt.informatik.rbg.hatlak.iso9660.ISOTask')
def params = [:]
params['destfile'] = 'minimal.iso'
def file = new File('/Users/kaakaa_hoe/Documents/codeIQ/shufflers/shufflers.txt')
Set resultList = new HashSet()
def cand = [:]
file.splitEachLine(' ') { array ->
def idList = getRegsList(array, /[0-9]+/)
def nameList = getRegsList(array, /[a-z]+/)
if(cand.size() == 0){
UWSC.test {
script {
$ 'SEND_KEY("hoge")'
$ 'SEND_KEY("fuga")'
}
assertUWSC {
assertTitle('title')
}
}
@kaakaa
kaakaa / gist:7891022
Created December 10, 2013 14:03
RMagickサンプル
require 'rubygems'
require 'RMagick'
rgp = Magick::ImageList.new('test.pdf')
p rgp.format
p rgp.columns
p rgp.rows
p rgp.size
rgp.each_with_index { |val, index|
def dsl = '''
person.is {
name 'taro'
age '28'
}.say()
'''
def impl = '''
def getPerson(){
new Person()
@kaakaa
kaakaa / gist:7028cacb68f5055c0eab
Created June 24, 2014 10:33
Gradle svn-ant Sample
configurations {
svnant
}
dependencies {
// lib/svnant配下にsvnantを展開
// => http://subclipse.tigris.org/svnant.html
svnant fileTree(dir: 'lib/svnant', include: '**/*.jar')
}