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
#! /bin/bash | |
TOKEN=xxxxx | |
curl -s -XPOST "https://slack.com/api/emoji.list?token=${TOKEN}" | jq -r '.emoji | to_entries[] | select(.value | test("^alias:") | not) | [.key, .value] | @tsv' | while IFS=$'\t' read -r emoji url; do | |
file="${emoji}.${url##*.}" | |
if [ ! -f ${file} ]; then | |
echo "The file does not exist: ${file}" | |
continue | |
fi | |
expected_size=$(curl -sI ${url} | awk '/Content-Length/{print $2}' | tr -d "\r\n") |
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
import org.apache.lucene.analysis.ja.JapaneseAnalyzer | |
import org.apache.lucene.analysis.ja.JapaneseTokenizer | |
import org.apache.lucene.analysis.ja.dict.UserDictionary | |
import org.apache.lucene.analysis.ja.tokenattributes.BaseFormAttribute | |
import org.apache.lucene.analysis.ja.tokenattributes.PartOfSpeechAttribute | |
import org.apache.lucene.analysis.ja.tokenattributes.ReadingAttribute | |
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute | |
import org.junit.Test | |
import java.io.StringReader |
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
# coding: utf-8 | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure("2") do |config| | |
# The most common configuration options are documented and commented below. |
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
import io.reactivex.Maybe; | |
import io.reactivex.Single; | |
import org.junit.Test; | |
public class SingleTest { | |
@Test public void testSingleConcat() { | |
Single<String> localSource = Single.create(emitter -> { | |
emitter.onError(new RuntimeException("1個目のError")); | |
}); |
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 A | |
FOO = 'foo' | |
end | |
class B < A | |
def self.foo | |
p FOO | |
end | |
class << self |
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
final Exception e = new Exception("Failure!"); | |
Single.zip(Single.just(1), Single.error(e), Pair::new) | |
.test() | |
.assertError(e); |
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
final Exception e = new Exception("Failure!"); | |
Observable.just(1) | |
.zipWith(Observable.error(e), Pair::new) | |
.test() | |
.assertError(e); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.hiroshi.adaptersample"> | |
<application | |
android:allowBackup="true" | |
android:icon="@mipmap/ic_launcher" | |
android:label="@string/app_name" | |
android:supportsRtl="true" | |
android:theme="@style/AppTheme"> |
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
import rx.Observable; | |
import rx.Subscriber; | |
import rx.Subscription; | |
import rx.schedulers.Schedulers; | |
public class UsingResourceSample { | |
public static void main(String[] args) throws InterruptedException { | |
for (int i = 0; i < 10; i++) { | |
Observable.using(() -> { | |
System.out.println("Getting @" + Thread.currentThread()); |
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
#! /bin/sh | |
WEBHOOK_URL=https://hooks.slack.com/services/XXXXXXXX | |
CHANNEL=#mychannel | |
echo "Starting notification for ${CHANNEL} with ${WEBHOOK_URL}" | |
if [ -z "$(which curl)" ];then | |
echo "curl command doesn't exist!" 1>&2 | |
exit 1 |