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
#!/bin/bash | |
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens" | |
trap onexit INT | |
function reset() { | |
echo 'Resetting status' | |
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22%22%2C%22status_emoji%22%3A%22%22%7D" > /dev/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
#!/bin/sh | |
# setup path | |
PATH=/usr/local/bin:/usr/bin:/bin | |
# remove stale/old files and update Homebrew | |
brew cleanup | logger -s | |
brew cask cleanup | logger -s | |
brew update | logger -s |
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
/** | |
* Tracks download of a DownloadManager job and reports progress. | |
*/ | |
internal class DownloadProgressUpdater(private val manager: DownloadManager, private val downloadId: Long, private var downloadProgressListener: DownloadProgressListener?) : Thread() { | |
private val query: DownloadManager.Query = DownloadManager.Query() | |
private var totalBytes: Int = 0 | |
interface DownloadProgressListener { | |
fun updateProgress(progress: Long) | |
} |
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
public class MobileOnlyNetworkTest { | |
private static final int TIMEOUT_SECONDS = 30; | |
public Test(Context context) { | |
Network network = getCellNetwork(context); | |
if (network != null) { | |
OkHttpClient client = getNetworkClient(network); | |
} | |
} | |
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
./gradlew clean | |
./gradlew --stop | |
rm -r .gradle | |
Restart Android Studio | |
Invalidate caches | |
Restart computer |
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
// Apply ZopFli compression to an APK at the command-line | |
zipalign -z 4 infile.apk outfile.apk | |
// Add the following to your build.gradle | |
//add zopfli to variants with release build type | |
android.applicationVariants.all { variant -> | |
if (variant.buildType.name == 'release') { | |
variant.outputs.each { output -> |
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
# This is an example CircleCI configuration file for building a fork of | |
# Google's CastVideos-android repo (https://github.com/googlecast/CastVideos-android) | |
# | |
# To try it: | |
# 1) Google's CastVideos-android repo: https://github.com/googlecast/CastVideos-android | |
# 2) Copy this file to your fork. | |
# 3) Add your fork as a project to CircleCI | |
general: | |
branches: |
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
#!/bin/bash | |
# | |
# Get rid of 'libpng warning: iCCP: Not recognizing known sRGB profile that has been edited' compilation warnings | |
# from AAPT by running this Bash shell script in the root folder of your Android project. This will use exiftool | |
# to remove PNG metadata (created by tools like Photoshop) from your Android project's PNG resources. | |
# | |
# NOTE: exiftool needs to be installed and in your path. Install it using homebrew or some other method. | |
# |
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 groovy.transform.Field | |
// This is a drop-in Gradle script that allows you to easily strip out the packages you don't need | |
// from the Google Play Services library. The script will keep track of previous runs to prevent | |
// restripping each time you build. | |
// HOW TO USE THIS | |
// | |
// 1) Download/copy this strip_google_play_services.gradle file into the same location of your app's | |
// build.gradle file. |
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
package com.yelp.android.ui.widgets; | |
import com.yelp.android.R; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; |
NewerOlder