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 LazyList { | |
def car | |
private Closure cdr | |
def LazyList next() { cdr() } | |
def List take(n) { | |
def r = []; def l = this | |
(1..n).each{ r << l.car; l++ } | |
return r | |
} | |
def LazyList filter(Closure pred) { |
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
// ==UserScript== | |
// @match http://famo.us/* | |
// ==/UserScript== | |
function addJQuery(callback) { | |
var script = document.createElement("script"); | |
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"); | |
script.addEventListener('load', function() { | |
var script = document.createElement("script"); | |
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();"; |
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
Integer result = tx(new UnitWork<Integer>() { | |
@Override | |
public Integer run() { | |
Employee employee = dao.selectById(1); | |
employee.setName("hoge"); | |
employee.setJobType(JobType.PRESIDENT); | |
return dao.update(employee); | |
} | |
}); |
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> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CSS Fizz Buzz</title> | |
<style> | |
#main li { | |
position: relative; | |
} | |
#main li:nth-child(3n):before { |
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
package example.mdsample.java; | |
import java.io.UnsupportedEncodingException; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.Arrays; | |
import javax.xml.bind.DatatypeConverter; | |
import org.apache.commons.lang3.ArrayUtils; |
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
package example.mdsample.java; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; |
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
package example; | |
import static org.hamcrest.core.Is.is; | |
import static org.junit.Assert.assertThat; | |
import java.util.EnumMap; | |
import java.util.LinkedList; | |
import java.util.List; | |
import java.util.TreeSet; |
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
public class QuizTest { | |
static class String { | |
public String(java.lang.String ignore) { | |
} | |
public boolean equals(Object anObject) { | |
return true; |
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
package janken; | |
public class じゃんけん { | |
public enum 結果 { | |
勝ち, 負け, あいこ | |
} | |
public enum 手 { | |
グー { |
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
package janken; | |
public class じゃんけん { | |
public enum 結果 { | |
あいこ, 負け, 勝ち | |
} | |
public enum 手 { | |
グー, チョキ, パー; |
OlderNewer