Skip to content

Instantly share code, notes, and snippets.

@t-kashima
t-kashima / sum_message_reactions_on_slack.rb
Last active February 2, 2018 14:20
sum message reactions on Slack
require 'slack'
Slack.configure do |config|
config.token = ENV['SLACK_TOKEN']
end
def getChannelHistory(client, latest, oldest)
client.channels_history(channel: ENV['CHANNEL_ID'], latest: latest, oldest: oldest, inclusive: true, count: 1000)
end
package com.unuuu.bookkeeper.view.adapter
...
class ExampleAdapter(context: Context) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
...
private val inflater: LayoutInflater = LayoutInflater.from(context)
private class CommentViewHolder(view: View) : RecyclerView.ViewHolder(view) {
@t-kashima
t-kashima / BaseActivity.kt
Last active July 19, 2017 15:20
Send transited activity to Fabric
...
override fun onResume() {
super.onResume()
saveTransitionScreenName()
val transitionScreenName = getTransitionScreenName()
Timber.d("ScreenName: " + transitionScreenName)
Crashlytics.setString("ScreenName", transitionScreenName)
}
@t-kashima
t-kashima / MainActivity.kt
Created May 8, 2017 09:51
MainActivityの実装
package com.unuuu.bookkeeper.activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.support.design.widget.FloatingActionButton
import android.support.design.widget.NavigationView
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
version: 2
jobs:
build:
working_directory: ~/working_directory
docker:
- image: beevelop/android:latest
environment:
ANDROID_HOME: /opt/android
steps:
- checkout
@t-kashima
t-kashima / change_encoding.sql
Last active March 27, 2017 06:53
change database encoding to utf8mb4.
use [database_name];
alter database [database_name] character set utf8mb4;
alter database [database_name] collate utf8mb4_general_ci;
alter table [table_name] character set utf8mb4;
alter table [table_name] modify [collumn name] varchar(255) character set utf8mb4 not null;
@t-kashima
t-kashima / app.yaml
Created December 10, 2016 17:07
Kotlin on Google App Engine
runtime: java
env: flex
@t-kashima
t-kashima / build.gradle
Last active July 22, 2017 07:54
Kotlin on Google App Engine
buildscript {
ext.kotlin_version = '1.0.5'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE'
classpath "com.google.cloud.tools:appengine-gradle-plugin:+"
@t-kashima
t-kashima / Application.kt
Created December 10, 2016 16:20
Kotlin on Google App Engine
package hello
import java.util.Arrays
import org.springframework.boot.CommandLineRunner
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.context.ApplicationContext
import org.springframework.context.annotation.Bean
@t-kashima
t-kashima / build.gradle
Last active December 10, 2016 16:18
Kotlin on Google App Engine
buildscript {
ext.kotlin_version = '1.0.5'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.springframework.boot:spring-boot-gradle-plugin:1.4.2.RELEASE'
}