This file contains hidden or 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
// file must be File object. | |
def calcSha1(file) | |
{ | |
MessageDigest md = MessageDigest.getInstance("SHA-1"); | |
file.eachByte 4096, {bytes, size -> | |
md.update(bytes, 0, size); | |
} | |
return md.digest().collect {String.format "%02x", it}.join(); | |
} |
This file contains hidden or 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
<html> | |
<title>test html</title> | |
With <a href="http://rawgit.com/">rawgit.com</a>, I can browse this Gist as HTML! | |
</html> |
This file contains hidden or 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 week4 | |
import scala.annotation.tailrec | |
abstract class List[T] { | |
def isEmpty: Boolean | |
def head: T | |
def tail: List[T] | |
override def toString = |
This file contains hidden or 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 final java.lang.String toStringAcc(scala.collection.mutable.StringBuilder, boolean); | |
Code: | |
0: aload_0 | |
1: invokevirtual #43 // Method isEmpty:()Z | |
4: ifeq 17 | |
7: aload_1 | |
8: ldc #45 // String ] | |
10: invokevirtual #49 // Method scala/collection/mutable/StringBuilder.append:(Ljava/lang/String;)Lscala/collection/mutable/StringBuilder; | |
13: invokevirtual #51 // Method scala/collection/mutable/StringBuilder.toString:()Ljava/lang/String; | |
16: areturn |
This file contains hidden or 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
#!/bin/bash | |
# all coordinate specified by percentage | |
x=75 | |
y=75 | |
w=12 | |
h=12 | |
color=yellow | |
icons=`cd src/main;echo res/*-*dpi/ic_launcher.png` |
This file contains hidden or 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
- A [*] (master trunk) | |
\- B0 - B1 - B2 (messy_branch) |
This file contains hidden or 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 bank(int amount) { | |
[withdraw: {n -> amount -= n}, | |
deposit: {n -> amount += n}, | |
check: {amount}] | |
} | |
account = bank(1000) | |
println account.check() |
This file contains hidden or 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
ThumbRemap_Init: | |
;1.有効にしたい方のコメントを削除 | |
;#Include %A_ScriptDir%\Thumb_ALPS.ahk | |
#Include %A_ScriptDir%\Thumb_Synaptics.ahk | |
;2.タッチパッドに触れているときのみ有効化したいリマップを列挙 | |
Thumb_Remap = | |
( |
This file contains hidden or 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
# returns list of reasons | |
def check_section(section) | |
case section.output_type | |
when 'text' | |
if section.content.match /.{0,10}<.{0,10}/ then | |
return $& | |
end | |
end | |
end | |
This file contains hidden or 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.net.URL; | |
public class UrlTest { | |
public static void main(String argv[]) throws Exception { | |
URL url1 = new URL("http://squiare.github.io/"); | |
URL url2 = new URL("http://google.github.io/"); | |
System.out.println( | |
String.format("\"%s\".equals(\"%s\") = %b", | |
url1.toString(), |