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
a1=( | |
hoge | |
fuga | |
piyo | |
) | |
a2=(foo "${a1[@]}") | |
echo ${#a2[@]} # => 4 | |
echo ${a2[1]} # => hoge |
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
#! 6to5-node | |
'use strict'; | |
class Struct { | |
static new(...props) { | |
return class { | |
static new(...args) { | |
return new this(...args); |
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
#! iojs --harmony | |
'use strict'; | |
class Struct { | |
static new() { | |
var props = Array.prototype.slice.call(arguments); | |
return class { | |
constructor() { |
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
buildscript { | |
repositories { | |
mavenCentral() | |
maven { url "http://repo.spring.io/snapshot" } | |
maven { url "http://repo.spring.io/milestone" } | |
} | |
dependencies { | |
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.4.RELEASE") | |
classpath("org.springframework:springloaded:1.2.0.RELEASE") | |
} |
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
function git() { | |
if [[ $1 == "clone" ]]; then | |
shift | |
ghq get $@ | |
else | |
command git $@ | |
fi | |
} |
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
function! s:complete_log(findstart, base) | |
if a:findstart == 1 | |
return col('.') | |
endif | |
let cmd = '\git log --pretty=format:%s --author=`\git config user.name` -30' | |
return split(system(cmd), '\n') | |
endfunction | |
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
MY=~/Applications/MyFirefoxNightly.app | |
ORIG=/Applications/FirefoxNightly.app | |
mkdir -p $MY/Contents/MacOS | |
mkdir -p $MY/Contents/Resources | |
cp $ORIG/Contents/Resources/firefox.icns $MY/Contents/Resources | |
cat <<EOS > $MY/Contents/MacOS/firefox.sh | |
#!/bin/sh | |
open -a $ORIG --args -P Nightly -no-remote | |
EOS | |
chmod +x $MY/Contents/MacOS/firefox.sh |
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
@Grapes(@Grab('org.jsoup:jsoup:1.7.3')) | |
import org.jsoup.Jsoup; | |
def text = Jsoup.parse(''' | |
<div> | |
<div class="foo">hoge</div> | |
<div class="bar">fuga</div> | |
<div class="foo">piyo</div> | |
</div> | |
''').select('.foo').text() |
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; | |
import java.security.Security; | |
public class Test3 { | |
public static void main(String... args) throws Exception { | |
Security.setProperty("networkaddress.cache.ttl" , "0"); | |
URL url = new URL("http://google.com"); | |
for (int i = 0; i < 100; i++) { | |
System.out.println(url.equals(new URL("http://google.com"))); |
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 sun.net.InetAddressCachePolicy; | |
import java.lang.reflect.Field; | |
public class Test2 { | |
public static void main(String... args) throws Exception { | |
Field f = InetAddressCachePolicy.class.getDeclaredField("cachePolicy"); | |
f.setAccessible(true); | |
System.out.println(f.get(null)); | |
} |
NewerOlder