This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>jQueryで大量データテーブル</title> | |
<style type="text/css"> | |
.viewport { | |
position: relative; | |
background: blue; | |
overflow: auto; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
//$("#xxxx").click(); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def beforeN(int n) { | |
new Date() - n | |
} | |
// 例: 100日前 | |
println beforeN(100) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import javax.xml.parsers.*; | |
import javax.xml.transform.*; | |
import javax.xml.transform.dom.*; | |
import javax.xml.transform.stream.*; | |
import org.w3c.dom.*; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Markdown { | |
/** 見出し:Atx形式 */ | |
String headerAtx(String md) { | |
def sharpSize = md.find(/^#+/).size() | |
if (sharpSize in 1..6) { | |
def tags = [ "<h${sharpSize}>", | |
"</h${sharpSize}>" ] | |
//def contents = md.replaceAll(/^#+\s*|\s*#+$/, '').trim() | |
def contents = md.replaceAll(/(?x) # enable whitespace and comments | |
^\#+ # 先頭からはじまるシャープ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String[] deal(int numPlayers, String deck) { | |
deck.toList().collate(numPlayers, false) | |
.transpose()*.join() ?: [''] * numPlayers | |
} | |
assert deal(3, '123123123') == ['111', '222', '333'] as String[] | |
assert deal(4, '123123123') == ['12', '23', '31', '12'] as String[] | |
assert deal(6, '012345012345012345') == ['000', '111', '222', '333', '444', '555'] as String[] | |
assert deal(4, '111122223333') == ['123', '123', '123', '123'] as String[] | |
assert deal(1, '012345012345012345') == ['012345012345012345'] as String[] | |
assert deal(6, '01234') == ['', '', '', '', '', ''] as String[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@GrabResolver(name='jline', root='http://jline.sourceforge.net/m2repo') | |
@Grab(group='jline', module='jline', version='0.9.9') | |
import jline.* | |
def prompt(ConsoleReader reader, String msg, Closure clos) { | |
while (true) { | |
def line = reader.readLine(msg) | |
if (line in [null, 'exit']) break | |
clos(line) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plus={ a, b -> a + b } | |
minus={ a, b -> a - b } | |
multiply={ a, b -> a * b } | |
div={ a, b -> a / b } |
NewerOlder