This file contains 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
import com.intellij.openapi.actionSystem.* | |
import com.intellij.openapi.application.* | |
import com.intellij.openapi.command.* | |
import com.intellij.openapi.diagnostic.* | |
import com.intellij.openapi.fileTypes.* | |
import com.intellij.openapi.progress.* | |
import com.intellij.openapi.project.* | |
import com.intellij.openapi.ui.* | |
import com.intellij.openapi.vfs.* | |
import com.intellij.psi.* |
This file contains 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
# Utilities for your BASH or ZSH profile that enable running ADB commands on multiple emulators/devices | |
function prepend() { while read line; do echo "${1}${line}"; done; } | |
# requires ADB on $PATH | |
madb(){ for SERIAL in `adb devices | sed '1d;$d' | cut -f 1`; do adb -s $SERIAL "$@" | prepend "[$SERIAL] "; done; } | |
# requires https://github.com/ashishb/adb-enhanced | |
madbe(){ for SERIAL in `adb devices | sed '1d;$d' | cut -f 1`; do adbe -s $SERIAL "$@" | prepend "[$SERIAL] "; done; } |
This file contains 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
// Utility to help with converting markdown on the clipboard into html on the | |
// clipboard for easy pasting of formatted text into a Google Doc in Chrome. | |
// | |
// Setup: | |
// - brew install pandoc | |
// - alias md2gd='pbpaste | pandoc -f markdown+smart -t html | pbcopy; swift pasteboardAsHtml.swift; echo "Copied to clipboard";' | |
// | |
// Usage: | |
// - <Copy some markdown text> | |
// - md2gd |
This file contains 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
/* | |
* Copyright (c) 2019. Uber Technologies | |
* | |
* 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 |
This file contains 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
from phabricator import Phabricator | |
username = 'USERNAME' | |
ph = Phabricator() | |
my_phid = ph.user.whoami().phid | |
phid = ph.user.find(aliases=[username])[username] | |
def diffs_search(constraints, after=None): | |
diffs = [] |
This file contains 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
class VectorDrawableInterceptor : Interceptor { | |
override fun intercept(chain: Interceptor.Chain): InflateResult { | |
val result = chain.proceed(chain.request()) | |
(result.view() as? TextView)?.let { textView -> | |
result.context().obtainStyledAttributes(result.attrs(), intArrayOf(android.R.attr.drawableLeft))?.let { ta -> | |
val drawableRes = ta.getResourceId(0, 0) | |
if (drawableRes != 0) { | |
val drawable = AppCompatResources.getDrawable(result.context(), drawableRes) | |
textView.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null) | |
} |
This file contains 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
import android.graphics.Bitmap; | |
import android.support.annotation.NonNull; | |
import com.bumptech.glide.load.Key; | |
import com.bumptech.glide.load.engine.Resource; | |
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; | |
import com.bumptech.glide.load.engine.cache.MemoryCacheAdapter; | |
import com.bumptech.glide.load.resource.bitmap.BitmapResource; | |
import com.squareup.picasso.LruCache; |