Skip to content

Instantly share code, notes, and snippets.

@caad1229
caad1229 / RxBillingWrapper.kt
Created May 19, 2019 11:38
Android Billing ClientClient を RxJava で使えるように Wrapping したクラス
/**
* アプリ内課金処理するためインターフェース
*
* [com.android.billingclient.api.BillingClient] を RxJava で使えるように wrapping しています。
* すべての BillingClient メソッドはUIスレッドから呼び出される必要があります。
* subscribeOn でのスレッド指定は [AndroidSchedulers.mainThread] にしてください。
*
* @param context for get instance of [BillingClient]
*/
@caad1229
caad1229 / docker with chef
Created October 28, 2017 17:30
docker image for chef. before build add ssh pub key in build directory.
FROM ubuntu:16.04
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y sudo vim git wget
RUN apt-get install -y openssh-server
#--------------------------------------
# chef
#--------------------------------------
FROM ubuntu:16.04
RUN set -x && apt-get update; apt-get upgrade
RUN apt-get -y install git tig vim wget
# git completion
RUN cd /root && \
wget https://raw.githubusercontent.com/git/git/v2.5.0/contrib/completion/git-completion.bash -O .git-completion.bash && \
wget https://raw.githubusercontent.com/git/git/v2.5.0/contrib/completion/git-prompt.sh -O .git-prompt.sh && \
wget -O - https://gist.githubusercontent.com/caad1229/f6c64ef41d58f15f5148/raw/8044d278579ca206a9e18a56a9027e4172dcb0bd/bashrc_ps1.sh | cat - >> .bash_profile
@caad1229
caad1229 / build.gradle
Created July 13, 2016 06:11
task for android to launching apk with build
def getSdkPath = {
def sdkDir
// local.propertiesからまずは読み込む
def localProperties = new File(rootDir, "local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream { instr ->
properties.load(instr)
}
sdkDir = properties.getProperty('sdk.dir')
@caad1229
caad1229 / Makefile
Created February 12, 2016 11:09
Makefile for cocos2d-x
REPO_ROOT := $(shell pwd)
USERPLATFORM = $(shell uname)
DEPLOY_DIR = $(REPO_ROOT)/deploy
#
# set platforms
#
PLATFORMS = android
ifeq ($(USERPLATFORM), Linux)
PLATFORMS += linux
@caad1229
caad1229 / cmd_test.py
Created August 12, 2015 09:35
command module test python script
from cmd import Cmd
class testCmd(Cmd):
prompt = "hoge) "
def __init__(self):
Cmd.__init__(self)
def do_exe(self, arg):
print "do anything"
@caad1229
caad1229 / bashrc_ps1.sh
Created May 8, 2015 06:46
customized PS1
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/'
}
function promps {
local BLUE="\[\e[1;34m\]"
local RED="\[\e[1;31m\]"
local GREEN="\[\e[1;32m\]"
local WHITE="\[\e[00m\]"
local GRAY="\[\e[1;37m\]"
@caad1229
caad1229 / sketch.ino
Created May 7, 2015 02:26
basic arduino test
#define LED_PIN 13
void setup() {
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
}
void loop() {
Serial.println("Hello Arduino");
digitalWrite(LED_PIN, HIGH); delay(100);
digitalWrite(LED_PIN, LOW); delay(900);
}