Skip to content

Instantly share code, notes, and snippets.

View JeppeLeth's full-sized avatar

Jeppe Leth JeppeLeth

View GitHub Profile
cwebp -pass 10 -mt -alpha_filter best -alpha_cleanup -m 6 -lossless
What do all these arguments do?
-pass 10 Determines the number of passes that will be performed on the image, maximum 10. More = longer processing time, but potentially smaller images. Yum.
-mt Use multi-threading
-alpha_filter best "predictive filtering for alpha plane", tries to optimize the alpha channel. Options are none, fast, and best.
-m 6 Determines compression method. 0=fast, 6=slowest
-lossless Makes this WebP lossless. Image produced will be 100% identical once decompressed.
@JeppeLeth
JeppeLeth / filter.regexp
Created July 8, 2016 20:15 — forked from stepango/filter.regexp
Filter for logcat
^(?!(NotificationManager|Timeline|SensorManager|Configs|libc-netbsd|art|stetho|Choreographer|CliptrayUtils|BubblePopupHelper|ViewRootImpl|libEGL|System.out|PhoneWindow))
@JeppeLeth
JeppeLeth / happy_git_on_osx.md
Created January 2, 2017 13:06 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "[email protected]"

@JeppeLeth
JeppeLeth / Getter Ignore m Prefix
Created February 5, 2017 13:43
Android Studio Getter/Setter Ignore m Prefix Templates
#if($field.modifierStatic)
static ##
#end
$field.type ##
#set($name = $StringUtil.capitalizeWithJavaBeanConvention($StringUtil.sanitizeJavaIdentifier($helper.getPropertyName($field, $project))))
#if ($field.boolean && $field.primitive)
#if ($StringUtil.startsWithIgnoreCase($name, 'is'))
#set($name = $StringUtil.decapitalize($name))
#else
is##
@JeppeLeth
JeppeLeth / build_android_sdk_version.gradle
Created April 14, 2017 07:43
Android gradle: Lastest buildToolsVersions and sdkVersion
import org.codehaus.groovy.runtime.StackTraceUtils
int[] sdksAvailable() {
def sdks = new ByteArrayOutputStream()
exec {
commandLine 'android', 'list'
standardOutput = sdks
}
sdks = sdks
// get the output
@JeppeLeth
JeppeLeth / gist:224e75abe56160a1f0e31ede0b807804
Last active April 15, 2017 07:56 — forked from paour/gist:11291062
Android String Weblate, Replacing values in arrays.xml with @string/ links
#! /usr/bin/python
import argparse
import os.path
import glob
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description='''\
Replacing values in arrays.xml with @string/ links. Generates three new files for each locale:
@JeppeLeth
JeppeLeth / convertLocalizable.rb
Created April 15, 2017 09:03 — forked from florianmski/convertLocalizable.rb
Convert your Localizable.strings (iOS) to strings.xml (Android)
#!/usr/bin/ruby
# based on https://github.com/tmurakam/cashflow/blob/0a01ac9e0350dfb04979986444244f8daf4cb5a8/android/convertStrings.rb
# support comments and Converter such as "%@", "%d", "%0.1f"...
# in your directory : ./main.rb Localizable.strings
file = File.open("strings.xml", "w");
file.puts "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
file.puts "<resources>"
@JeppeLeth
JeppeLeth / LocalizeStringsFromAndroid.rb
Created April 15, 2017 09:24 — forked from ebaker355/LocalizeStringsFromAndroid.rb
Translate Android strings.xml files to iOS Localizable.strings files
#!/usr/bin/env ruby
# gist: https://gist.github.com/3217498
# This script can be called from an Xcode 'Run Script' build phase at the
# beginning of the build process, like this:
#
# ${PROJECT_DIR}/LocalizeStringsFromAndroid.rb ${PROJECT_NAME}
#
# This script should be placed in the same directory as your .xcodeproj
@JeppeLeth
JeppeLeth / clear-android-things-apps.sh
Created April 18, 2017 18:28 — forked from blundell/clear-android-things-apps.sh
Uninstall all apps on an Android Device that have the intent-filter category IOT_LAUNCHER
#!/bin/bash
sp="/-\|"
sc=0
spin() {
printf "\b${sp:sc++:1}"
((sc==${#sp})) && sc=0
}
endspin() {
printf "\r"
}
@JeppeLeth
JeppeLeth / fix_strings.md
Created June 9, 2017 07:01 — forked from Superbil/fix_strings.md
Fix *.strings can't diff in git