Skip to content

Instantly share code, notes, and snippets.

View kakajika's full-sized avatar
🏠
STAY HOME

Keita Kajiwara kakajika

🏠
STAY HOME
View GitHub Profile
@akio0911
akio0911 / DateExtension.swift
Last active April 11, 2018 12:39
Dateのextensionに依存性注入してみる
extension Date {
struct Extension {
let date: Date
struct Dependencies {
let calendar: Calendar
let locale: Locale
let timeZone: TimeZone
}
@yusuke
yusuke / Android Studio30分集中超絶技巧100選メモ DroidKaigi 2018 #DroidKaigi #DroidKaigi_room3
Created February 9, 2018 02:10
Android Studio30分集中超絶技巧100選メモ DroidKaigi 2018 #DroidKaigi #DroidKaigi_room3
Android Studio30分集中超絶技巧100選 DroidKaigi 2018
山本 ユウスケ @yusuke
マウス、トラックパッドを使うのはやめましょう
今日は以下のキーマップの話です
Mac OSX: Mac OSX 10.5+
Windows/Linux: Default
他のキーマップだとQiitaやドキュメント、ブログなどを見る際に苦労します。
設定画面 Cmd + , (Ctrl + Alt + S)
プロジェクト設定画面 Cmd + ;
File > Power Save Modeでバッテリー節約
@LouisCAD
LouisCAD / GooglePlayServices.kt
Created November 23, 2017 16:19
Allows using Google Play Services Task API in Kotlin Coroutines, plus Play Services availability check made easier.
import com.google.android.gms.common.GoogleApiAvailability
import com.google.android.gms.tasks.Task
import splitties.init.appCtx
import kotlin.coroutines.experimental.suspendCoroutine
val googleApiAvailability = GoogleApiAvailability.getInstance()!!
inline val playServicesAvailability get() = googleApiAvailability.isGooglePlayServicesAvailable(appCtx)
@JvmName("awaitVoid")
suspend fun Task<Void>.await() = suspendCoroutine<Unit> { continuation ->
@rharter
rharter / SharedPreferenceLiveData.kt
Last active March 19, 2023 08:15
Creates LiveData objects that observe a value in SharedPreferences while they have active listeners.
import android.arch.lifecycle.LiveData
import android.content.SharedPreferences
abstract class SharedPreferenceLiveData<T>(val sharedPrefs: SharedPreferences,
val key: String,
val defValue: T) : LiveData<T>() {
private val preferenceChangeListener = SharedPreferences.OnSharedPreferenceChangeListener { sharedPreferences, key ->
if (key == this.key) {
value = getValueFromPreferences(key, defValue)
@yamacraft
yamacraft / Firebase-Admin-NodeJs.md
Last active January 4, 2023 10:28
node.jsからサービスアカウント使ってFirebaseへ接続する時のメモ

検索ワード:Firebase Auth サービスアカウント nodejs

(注意)日本語版の情報は既に少し古い

下準備

サービスアカウントの作成

  1. Firebaseコンソールサイト>歯車>権限 でGoogle APIコンソールっぽい管理画面へ。
  2. サービスアカウント>サービスアカウントを作成をクリックしてアカウントを作成
/*
* Copyright 2016 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
{
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": ["source.kt"],
"shell_cmd": "gradle -Pmain=\"${file_name}\""
}
@hiroyuki-seto
hiroyuki-seto / ContextMenu.md
Created November 10, 2016 12:35
Android Nで変わったContextMenuまわり

Android Nで変わったContextMenuまわり

知りたかった点

  • Nでは長押しした位置にContextMenuが出るがどうやっているか
  • View#performLongClick(int,int)View#showContextMenu(int,int)が追加されている
  • View#performLongClickInternalで指の位置があるかによってshowContextMenu(int,int)showContextMenu()を呼び分け
  • NではDarkThemeにするとPopupWindowが黒背景になるが、どうにかならんのか
  • M以前はDialogだったのでテーマを書き換えられた。NはPopupかつcom.android.internal.R.attr.contextPopupMenuStyleを使っているのできびしそう?

追ってみた

@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@mono0926
mono0926 / commit_message_example.md
Last active March 29, 2024 03:40
[転載] gitにおけるコミットログ/メッセージ例文集100