Skip to content

Instantly share code, notes, and snippets.

❯ git clone https://github.com/JetBrains/kotlin-native.git
@bassaer
bassaer / cassandra.yaml
Last active October 20, 2018 07:49
cassandraセットアップメモ ref: https://qiita.com/bassaer/items/caaa4e78f98040e87c93
#start_rpc: false
start_rpc: true
#rpc_address: localhost
rpc_address: 192.168.33.10
@bassaer
bassaer / file0.txt
Created September 8, 2018 15:29
ifconfigからIPアドレスを抽出するメモ ref: https://qiita.com/bassaer/items/888ae3715ede42e67c86
❯ ifconfig en0 | grep 'inet\s' | cut -d ' ' -f 2
192.168.11.8
@bassaer
bassaer / MainActivity.kt
Last active May 19, 2018 06:18
ネストしたデータをresourceで管理する ref: https://qiita.com/bassaer/items/b1d3f9bacb03033e3a46
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
loadMenu()
}
private fun loadMenu() {
val tag = "Sample"
@bassaer
bassaer / file0.txt
Last active May 12, 2018 15:45
xmlファイル内をsedで置換するメモ ref: https://qiita.com/bassaer/items/067d982400c54ba9ef3c
~ vagrant@localhost
❯ cat foo
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="colors">
<item>amber</item>
<item>blue</item>
<item>blue grey</item>
<item>brown</item>
<item>cyan</item>
❯ brew update
❯ brew install kotlin
@bassaer
bassaer / file0.txt
Created April 23, 2018 12:23
Androidでキーボードを閉じる方法メモ ref: https://qiita.com/bassaer/items/0e412d9f36b2113ee8d0
class ContentFragment : Fragment() {
private fun hideKeyboard() {
val view = activity.currentFocus
if (view != null) {
val manager = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
manager.hideSoftInputFromWindow(view.windowToken, 0)
}
}
@bassaer
bassaer / build.gradle
Last active February 11, 2018 14:46
gradleでjarから特定のパッケージだけを取り除く ref: https://qiita.com/bassaer/items/0b1fdf4a4ba0462afed8
buildscript {
ext.kotlin_version = '1.2.10'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@bassaer
bassaer / file0.txt
Created December 24, 2017 08:41
kotlin書き換え時の「エラー: パッケージxxxは存在しません」「エラー: シンボルを見つけられません」対処メモ ref: https://qiita.com/bassaer/items/01fe28de03096e1b2ef6
/Users/nakayama/StudioProjects/ChatMessageView/example/src/androidTest/java/com/github/bassaer/example/MessengerActivityTest.java:13: エラー: パッケージcom.github.bassaer.example.matcherは存在しません
import com.github.bassaer.example.matcher.MessageListMatcher;
^
/Users/nakayama/StudioProjects/ChatMessageView/example/src/androidTest/java/com/github/bassaer/example/MessengerActivityTest.java:146: エラー: シンボルを見つけられません
onView(withId(R.id.message_view)).check(matches(MessageListMatcher.withListSize(0)));
@bassaer
bassaer / config.yml
Last active September 10, 2018 17:39
CircleCI 2.0でAndroidライブラリの自動デプロイ ref: http://qiita.com/bassaer/items/6b9aedae4571d59f0fdf
version: 2
jobs:
build:
branches:
only:
- master
- develop
docker:
# specify the version you desire here
- image: circleci/android:api-26-alpha