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
# http://d.hatena.ne.jp/keyesberry/20110908/p1 | |
# 上でプライベートメソッドがうまく定義できなかった理由を, | |
# http://d.hatena.ne.jp/yogit/20110921/1316592709 | |
# から探る | |
# あと,こちらも | |
# http://sucrose.hatenablog.com/entry/20120229/p1 | |
class Duck | |
constructor: (@name, @age) -> | |
# 今回の結論. |
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_DIRNAME=$(dirname $0) | |
cd $MY_DIRNAME | |
cd YOUR_APP_DIR | |
echo "インストール先を選んでください" | |
# sedで余計な文字列を削除し,selectでANSに選ばれた選択肢を入れる | |
select ANS in `adb devices | sed -e "s/List of devices attached//" | sed -e "s/device//"` | |
# 入力値が適切な値かどうかチェック | |
do | |
if [ -z "$ANS" ]; then |
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
max_y = 0 | |
max_z = 0 | |
for a in 0..252 do | |
for b in 0..252 do | |
x = (((95*2 + 31 + a / 4.0) * 0.5) + 60).truncate | |
y = (((80*2 + 31 + b / 4.0) * 0.5 + 5)).truncate | |
next if (506 - a - b > 252) | |
for c in 0..(506-a-b) do | |
z = (((80 * 2 + 31 + c / 4.0) * 0.5 + 5)*1.1).truncate |
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
javascript: | |
(function(){ | |
if(document.URL.indexOf('amazon.co.jp') == -1){ | |
prompt('コピーしてください','`'+document.title+'%20'+'<'+document.URL+'>`_'); | |
} | |
else { | |
var title = document.getElementById('btAsinTitle').textContent; | |
var b = document.getElementsByTagName('b'); | |
var r; | |
for(i=0;i<b.length;i++)if(/ISBN-13/i.test(b[i].innerHTML))r=b[i].parentNode.innerHTML.match(/(\d{3})-(\d+)/); |
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
# coding: utf-8 | |
require 'yaml' | |
# ruby2.0.0に組み込み | |
require 'nokogiri' | |
require 'open-uri' | |
require 'term/ansicolor' | |
# gem install term-ansicolor | |
include Term::ANSIColor | |
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 void testMockCreating() { | |
try { | |
PublicClass instance = mock(PublicClass.class); | |
} catch (IllegalAccessError e) { | |
fail(); | |
} | |
try { | |
PublicButInheritedStaticPackageProtectedClass instance; | |
instance = mock(PublicButInheritedStaticPackageProtectedClass.class); |
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.io.IOException; | |
import javax.xml.parsers.DocumentBuilder; | |
import javax.xml.parsers.DocumentBuilderFactory; | |
import javax.xml.parsers.ParserConfigurationException; | |
import net.arnx.jsonic.JSON; | |
import org.w3c.dom.Document; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer