Skip to content

Instantly share code, notes, and snippets.

Takaumi Kimura KimuraTakaumi

Block or report user

Report or block KimuraTakaumi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KimuraTakaumi
KimuraTakaumi / BuildConfig.java
Created Jul 31, 2016
AARファイルからアプリのBuildConfigのDEBUGを読み込む
View BuildConfig.java
public static boolean isDebug(Context context){
try {
Class<?> clazz = Class.forName(context.getPackageName() + ".BuildConfig");
Field field = clazz.getField("DEBUG");
return (Boolean) field.get(null);
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
return false;
}
@KimuraTakaumi
KimuraTakaumi / MainActivity.java
Created Apr 24, 2016
RxJavaのmapでのエラー処理(onError)
View MainActivity.java
private void checkRxJavaOnError() {
String[] urls = {"https://www.google.co.jp/?gws_rd=ssl",
"http://techium.hatenablog.com/",
"http://localhost/"};
Observable
.from(urls)
.subscribeOn(Schedulers.newThread())
.map(new Func1<String, Boolean>() {
@KimuraTakaumi
KimuraTakaumi / index.js
Created Apr 17, 2016
Botkitを使ってSlackユーザーに要件を尋ねる
View index.js
var Botkit = require('botkit');
var controller = Botkit.slackbot({
debug: false
});
controller.spawn({
token: process.env.token
}).startRTM();
@KimuraTakaumi
KimuraTakaumi / index.js
Created Apr 17, 2016
Botkitを使ってSlackの応答を返す
View index.js
var Botkit = require('botkit');
var controller = Botkit.slackbot({
debug: false
});
controller.spawn({
token: process.env.token
}).startRTM();
@KimuraTakaumi
KimuraTakaumi / index.html
Last active Apr 3, 2016
ElectronでNotificationを表示する(メインプロセス)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<script type="text/javascript">
var main = require("remote").require("./main");
function notificationMainProcess() {
main.notificationMainProcess();
}
@KimuraTakaumi
KimuraTakaumi / index.html
Last active Apr 3, 2016
ElectronでNotificationを表示する(レンダラープロセス)
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<script type="text/javascript">
function notification() {
new Notification("Hello World");
}
</script>
@KimuraTakaumi
KimuraTakaumi / index.html
Created Mar 26, 2016
Electronでプロセス間通信(remote) 引数が関数
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<script type="text/javascript">
var main = require("remote").require("./main");
// functionを引数に設定し、MainProcess側で実行する
function exampleRemoteArgsFunc() {
console.log("exampleRemoteArgsFunc");
@KimuraTakaumi
KimuraTakaumi / index.html
Created Mar 26, 2016
Electronでプロセス間通信(remote) 引数あり
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<script type="text/javascript">
var main = require("remote").require("./main");
// 引数を設定し、MainProcess側に値を渡す
function exampleRemoteArgsText() {
console.log("exampleRemoteArgsText");
@KimuraTakaumi
KimuraTakaumi / index.html
Created Mar 26, 2016
Electronでプロセス間通信(remote) 引数なし
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<script type="text/javascript">
var main = require("remote").require("./main");
// remoteでMainProcessのメソッドを呼び出す。
function exampleRemote() {
console.log("exampleRemote");
@KimuraTakaumi
KimuraTakaumi / index.html
Last active Mar 26, 2016
Electronでプロセス間通信(ipc) MainProcessからRendererProcessへ非同期通信
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
<script type="text/javascript">
var ipc = require('ipc');
// 非同期でメインプロセスからのメッセージを受信する
ipc.on('main-process-message', function(args) {
console.log("main process message : " + args);
You can’t perform that action at this time.