Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
ninepatch { | |
round_rect { | |
vStretch 8, 32 | |
hStretch 8, -8 | |
vPadding 7, 33 | |
hPadding 7, -7 | |
} | |
} |
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/sh | |
if [ -z "$ANDROID_HOME" ] ; then | |
echo Please set ANDROID_HOME >&2 | |
fi | |
for jar in "${ANDROID_HOME}"/platforms/android-*/android.jar ; do | |
sdkVer=`expr "${jar}" : '.*/\(android-[0-9]*\)/android.jar'` | |
jar tf "$jar" | sed -n '/^java.*\.class/{s/\.class$//; s,/,.,g; p;}' |sort > sdk-${sdkVer} | |
done |
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 waitForEmulatorReady() { | |
def bootanim = '' | |
def failCounter = 0 | |
while (!(bootanim =~ /stopped/)) { | |
def adbProcess = 'adb -e shell getprop init.svc.bootanim'.execute() | |
def errCode = adbProcess.waitFor() | |
if (errCode != 0) { | |
failCounter += 1 | |
if (failCounter > 3) { | |
throw new RuntimeException('failed to start emulator') |
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 com.android.build.gradle.internal.tasks.DeviceProviderInstrumentTestTask | |
import com.android.builder.testing.api.DeviceConnector | |
def isDeviceReady(DeviceConnector device) { | |
def res = device.getSystemProperty('init.svc.bootanim').get() | |
return res == 'stopped' | |
} | |
def waitForAllDevicesReady(DeviceProviderInstrumentTestTask testTaks) { | |
// Add time out? |
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/sh -e | |
function show_latest_branches () { | |
git branch | \ | |
sed 's/[* ]//g; s/.*/printf "& "; git show --format="%at" -s &/'| \ | |
sh | \ | |
sort -k2nr | |
} | |
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 hoge; | |
import rx.*; | |
import rx.schedulers.*; | |
import java.util.concurrent.TimeUnit; | |
// See the items in backpressure bufffer will be genereated | |
// for the observer who subscribed later? | |
public class SubscribeLater { |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<svg | |
xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink" | |
width="40px" height="40px" viewBox="0 0 40 40" version="1.1" > | |
<path | |
d="M10,10 30,10 30,30 10,30 Z M15,15 25,15 25,25 15,25 Z" | |
fill="#ff0000" fill-rule="evenOdd" /> | |
</svg> |
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
# Trivial example: 2017-01-01 is part of the last week of 2016 because ISO week starts with the Monday. | |
irb(main):004:0> fd2017 = Date.new(2017,1,1) | |
=> #<Date: 2017-01-01 ((2457755j,0s,0n),+0s,2299161j)> | |
irb(main):005:0> fd2017.cweek | |
=> 52 | |
irb(main):006:0> fd2017.cwday | |
=> 7 # Sunday | |
irb(main):007:0> fd2017.cwyear | |
=> 2016 |
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.lang.ref.WeakReference; | |
public class Www { | |
public static void main(String args[]) { | |
Runnable r0 = create0(); | |
Runnable r1 = create1(); | |
System.gc(); | |
r0.run(); | |
r1.run(); |