Skip to content

Instantly share code, notes, and snippets.

@keyboardsurfer
keyboardsurfer / Android iterm.json
Created September 27, 2022 14:05
Android iTerm style
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.32549019607843138,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 1,
@keyboardsurfer
keyboardsurfer / AndroidManifest.xml
Created November 10, 2020 11:49
Install time configuration
/* Copyright 2020 Google LLC.
SPDX-License-Identifier: Apache-2.0 */
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.google.android.samples.playcore.picture">
<uses-feature android:name="android.hardware.camera" android:required="true" />
<dist:module dist:title="@string/module_feature_picture">
@keyboardsurfer
keyboardsurfer / installFromBundle
Last active August 8, 2020 15:33
Build & extract a set of apk from an aab for a specific device and install the results on it.
#!/bin/sh
# Build & extract a set of apk from an aab for a specific device and install the results on it.
#
# This needs https://github.com/google/bundletool to be available as `bundletool`.
# Also **exactly** one device needs to be connected to adb.
# Usage: installFromBundle bundle.aab
# optional `--extract-apks` to keep the set on your workstation as well.
basename=${1%%.*}
keystore="~/.android/debug.keystore"
@keyboardsurfer
keyboardsurfer / apply_gitignore
Created February 2, 2015 15:04
applies changes to a .gitignore file to a repository
git rm -r --cached && git add .
@keyboardsurfer
keyboardsurfer / studio64.vmoptions
Created January 26, 2015 10:02
My vmoptions for android studio
-Xms1G
-Xmx8G
-XX:MaxPermSize=4G
-XX:ReservedCodeCacheSize=512m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djna.nosys=true
-Djna.boot.library.path=
@keyboardsurfer
keyboardsurfer / gw
Last active March 16, 2020 14:40
function to use gradle wrapper if it exists, else gradle
# Simply add this to your .bashrc, .zshrc or .whateverrc and re-source it.
# Afterwards you can use `gw` to invoke your local gradle wrapper if it exists.
function gw {
if [ -x "gradlew" ]; then
./gradlew $@
else
gradle $@
fi
}
@keyboardsurfer
keyboardsurfer / flavor_names_build.gradle
Last active January 13, 2021 09:24
Version names for application variants
android {
applicationVariants.all { variant ->
def flavor = variant.mergedFlavor
def name = flavor.getVersionName()
def versionName = name + '-' + variant.properties.get('flavorName')
if (variant.buildType.isDebuggable()) {
versionName += '-debug';
}
flavor.versionName = versionName;
}

Keybase proof

I hereby claim:

  • I am keyboardsurfer on github.
  • I am keyboardsurfer (https://keybase.io/keyboardsurfer) on keybase.
  • I have a public key whose fingerprint is 815B F952 DCFC C8F8 59C2 E6C1 8424 F9C1 E763 A74C

To claim this, I am signing this object:

@keyboardsurfer
keyboardsurfer / build.gradle
Created November 18, 2013 14:26
SmartExtensionsAPI v2.1
apply plugin: "android-library"
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5+'
@keyboardsurfer
keyboardsurfer / build.gradle
Created November 18, 2013 14:25
SmartExtensionUtil v2.1
apply plugin: "android-library"
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5+'