Skip to content

Instantly share code, notes, and snippets.

View file0.txt
❯ git clone https://github.com/JetBrains/kotlin-native.git
View cassandra.yaml
#start_rpc: false
start_rpc: true
#rpc_address: localhost
rpc_address: 192.168.33.10
@bassaer
bassaer / file0.txt
Created Sep 8, 2018
ifconfigからIPアドレスを抽出するメモ ref: https://qiita.com/bassaer/items/888ae3715ede42e67c86
View file0.txt
❯ ifconfig en0 | grep 'inet\s' | cut -d ' ' -f 2
192.168.11.8
@bassaer
bassaer / MainActivity.kt
Last active May 19, 2018
ネストしたデータをresourceで管理する ref: https://qiita.com/bassaer/items/b1d3f9bacb03033e3a46
View MainActivity.kt
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
xmlファイル内をsedで置換するメモ ref: https://qiita.com/bassaer/items/067d982400c54ba9ef3c
View file0.txt
~ 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>
View file0.txt
❯ brew update
❯ brew install kotlin
@bassaer
bassaer / file0.txt
Created Apr 23, 2018
Androidでキーボードを閉じる方法メモ ref: https://qiita.com/bassaer/items/0e412d9f36b2113ee8d0
View file0.txt
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 Feb 11, 2018
gradleでjarから特定のパッケージだけを取り除く ref: https://qiita.com/bassaer/items/0b1fdf4a4ba0462afed8
View build.gradle
buildscript {
ext.kotlin_version = '1.2.10'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@bassaer
bassaer / file0.txt
Created Dec 24, 2017
kotlin書き換え時の「エラー: パッケージxxxは存在しません」「エラー: シンボルを見つけられません」対処メモ ref: https://qiita.com/bassaer/items/01fe28de03096e1b2ef6
View file0.txt
/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 Sep 10, 2018
CircleCI 2.0でAndroidライブラリの自動デプロイ ref: http://qiita.com/bassaer/items/6b9aedae4571d59f0fdf
View config.yml
version: 2
jobs:
build:
branches:
only:
- master
- develop
docker:
# specify the version you desire here
- image: circleci/android:api-26-alpha