Skip to content

Instantly share code, notes, and snippets.

View kgmyshin's full-sized avatar
🍶
I want to drink

Shinnosuke Kugimiya kgmyshin

🍶
I want to drink
View GitHub Profile
@kgmyshin
kgmyshin / AppInjector.kt
Last active October 26, 2018 02:13
マルチモジュール時のDagger-AndroidでのInject
import android.app.Activity
import androidx.fragment.app.Fragment
import dagger.android.DispatchingAndroidInjector
import javax.inject.Inject
class AppInjector : HasDispatchingFragmentInjector {
@Inject
lateinit var supportFragmentInjector: DispatchingAndroidInjector<Fragment>
@kgmyshin
kgmyshin / Extension.kt
Last active January 6, 2018 05:25
toSingleOptional
fun <T> Maybe<T>.toSingleOptional(): Single<Optional<T>> = RxJavaPlugins.onAssembly(MaybeToSingleOptional<T>(this))
@kgmyshin
kgmyshin / gist:4dfc8f807e6f07fc82082f999afbe348
Created October 28, 2017 04:42
kotlin系jarをclasspathに含めるかどうかで変わる -> というより gradle plugin実行時のClassLoader.getSystemClassLoaderの振る舞いが変わる?
val classLoader = URLClassLoader(
arrayOf(クラスファイル群パス),
ClassLoader.getSystemClassLoader()
)
val clazz = classLoader.loadClass("クラス名")
println("clazz.annotations.size: " + clazz.declaredAnnotations.size + " ")
@kgmyshin
kgmyshin / LintIssureRegistory.java
Last active January 6, 2017 07:34
RxJava2SubscribeOnErrorDetector
package com.kgmshin.lint;
import com.android.tools.lint.client.api.IssueRegistry;
import com.android.tools.lint.detector.api.Issue;
import java.util.Collections;
import java.util.List;
public class LintIssueRegistry extends IssueRegistry {
@kgmyshin
kgmyshin / Hello World memo
Created December 6, 2015 04:35
Javaクラスファイルで Hello, World
- magic
CAFEBABE
- minor_virsion
0000
- major_version
0034
- constant_pool_count
@kgmyshin
kgmyshin / mov2gif.sh
Created September 26, 2015 15:05
mov2gif.sh
mkdir ________work
ffmpeg -i $0 -an -r 15 ________work/%04d.png
convert work/*.png __mov.gif
rm -r ________work
@kgmyshin
kgmyshin / checkstyle.xml
Created September 8, 2015 16:38
checkstyle.xml
<?xml version="1.0"?><!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<!--module name="NewlineAtEndOfFile"/-->
<module name="FileLength" />
<module name="FileTabCharacter" />
@kgmyshin
kgmyshin / private.xml
Last active May 17, 2021 01:58
karabiner private.xml
<?xml version="1.0"?>
<root>
<!-- for RealForce -->
<devicevendordef>
<vendorname>RealForce_VendorID</vendorname>
<vendorid>0x0853</vendorid>
</devicevendordef>
<deviceproductdef>
@kgmyshin
kgmyshin / Android MのPermissionの個別設定情報の保存場所について
Last active August 29, 2015 14:23
Android MのPermissionの個別設定情報の保存場所について
Permissionのファイルは
/data/system/users/{userId}/runtime-permissions.xml
ここにこういうのが入ってる
```runtime-permissions.xml
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<runtime-permissions>
<pkg name="com.android.launcher">
@kgmyshin
kgmyshin / template.rb
Last active August 29, 2015 14:18
rails new new_project_name -m template.rb
gem 'haml-rails'
gem 'erb2haml'
gem_group :development, :test do
gem 'hirb'
gem 'hirb-unicode'
gem 'pry-rails'
gem 'pry-doc'
gem 'pry-byebug'
gem 'rspec-rails', '~> 3.0'