This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Toastの簡易版 | |
* | |
* @param text 表示文字列 | |
* @param duration デフォルト: Toast.LENGTH_LONG | |
* @return {@link Toast} | |
*/ | |
@Suppress("NOTHING_TO_INLINE") | |
inline fun Context.toast(text: CharSequence, duration: Int = Toast.LENGTH_LONG): Toast { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#メモリ -Xmx: AndroidStudio起動時 | |
org.gradle.jvmargs=-Xmx3072M -Xmx4096M -XX:MaxPermSize=2048M | |
#並列ビルドモードを有効 | |
org.gradle.parallel=true | |
#必要な部分をビルド | |
org.gradle.configureondemand=true | |
#デーモンプロセスを使う | |
org.gradle.daemon=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object ServiceGenerator { | |
private lateinit var moshi: Moshi | |
private lateinit var retrofit: Retrofit | |
/** | |
* Initialize{@link Moshi}and{@link Retrofit} | |
*/ | |
fun init(context: Context?) { | |
moshi = Moshi.Builder() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Show current path | |
xcode-select -print-path | |
# Switch xcode | |
xcode-select --switch /Applications/XcodeXX.app | |
# Search active xcodebuild path | |
xcrun --find xcodebuild | |
# Show simulator list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tree -a -I '.git|node_modules|.bundle|vendor|.DS_Store' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Mouse | |
ioreg -c BNBMouseDevice | grep BatteryPercent | grep -v { | sed 's/[^[:digit:]]//g' | |
# Keyboard | |
ioreg -c AppleBluetoothHIDKeyboard | grep BatteryPercent | grep -v { | sed 's/[^[:digit:]]//g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* canvas_loupe.js | |
*/ | |
var loupe = { | |
x: 0, // Current x. | |
y: 0, // Current y. | |
w: 0, // Image width. | |
h: 0, // Image height. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex) | |
irb | |
2.1.0 :001 > require 'active_support' | |
=> true | |
2.1.0 :002 > cahce = ActiveSupport::Cache::MemoryStore.new | |
=> <#ActiveSupport::Cache::MemoryStore entries=0, size=0, options={}> | |
2.1.0 :006 > cahce.method(:blank?).source_location | |
=> ["/Users/xxxx/vendor/bundle/ruby/2.1.0/gems/activesupport-4.2.5.1/lib/active_support/core_ext/object/blank.rb", 16] | |
2.1.0 :007 > cahce.method(:blank?).owner | |
=> Object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo "make directory build" | |
mkdir build | |
cd build | |
cmake .. | |
make | |
echo "copy header and library" | |
sudo cp -r ../googletest/include/gtest /usr/local/include/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
refname = ARGV[0] | |
oldrev = ARGV[1] | |
newrev = ARGV[2] | |
puts "push info >> \n(#{refname}) (#{oldrev[0,6]}) (#{newrev[0,6]})" | |
sharevs = `git rev-list #{oldrev[0,6]}..#{newrev[0,6]}`.split("\n") | |
sharevs.each do |rev| |