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
@mono0926
mono0926 / commit_message_example.md
Last active March 29, 2024 03:40
[転載] gitにおけるコミットログ/メッセージ例文集100
@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でバッテリー節約
@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
@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
@nickbutcher
nickbutcher / 1 search_bar.xml
Last active March 26, 2022 10:03
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 The Android Open Source Project
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
@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 ->
@kakajika
kakajika / PathSimplifier.swift
Last active July 14, 2020 13:22
SwiftによるCGPathの曲線近似の実装(Inspired by paper.js)
// PathSimplifier.swift
import UIKit
private let TOLERANCE: CGFloat = 1e-6
private let EPSILON: CGFloat = 1e-12
extension CGPoint {
func add(p: CGPoint) -> CGPoint {
return CGPointMake(x+p.x, y+p.y)
@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を使っているのできびしそう?

追ってみた