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
// Photoshop script to resize canvas and export | |
// You can add this script to Action for automation | |
doc = app.activeDocument; | |
// change the color mode to RGB. Important for resizing GIFs with indexed colors, to get better results | |
doc.changeMode(ChangeMode.RGB); | |
// default background color filling in when resizing canvas | |
var bgColor = new SolidColor(); |
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
include ':app' | |
def includeModules = { String extModuleDir, moduleList -> | |
// def extModuleDir = 'aw-common' | |
// def moduleList = ['wear-common', 'engine'] | |
for (String moduleName in moduleList) { | |
def module = ":" + moduleName | |
include module | |
// ...must change projectDir for each module | |
project(module).projectDir = new File(extModuleDir, moduleName) |
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 | |
start=\\033[ | |
end=\\033[0m | |
Green=${start}32m | |
Yellow=${start}33m | |
Blue=${start}34m | |
Red=${start}31m | |
echo_d() { | |
echo -e "${Blue}${1}${end}" |
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
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -l -GFh' | |
alias l='ls -l -GFh' | |
alias ll='ls -la' | |
alias lm='ls | more' | |
alias llm='ls -la | more' | |
export PATH=$PATH:/Users/xxx/Library/Android/sdk/platform-tools/ |
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
StringBuilder sb = new StringBuilder("---------------"); | |
sb.append("Count = "); | |
sb.append(TimeZone.getAvailableIDs().length); | |
sb.append("\n"); | |
Log.i("Time", sb.toString()); | |
for (String timezoneId : TimeZone.getAvailableIDs()) { | |
sb.replace(0, sb.length()-1, timezoneId); | |
Log.i("Time", sb.toString() + "\n"); | |
} |
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
Africa/Abidjan | |
Africa/Accra | |
Africa/Addis_Ababa | |
Africa/Algiers | |
Africa/Asmara | |
Africa/Asmera | |
Africa/Bamako | |
Africa/Bangui | |
Africa/Banjul | |
Africa/Bissau |
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
void dumpDataset(DataSet dataSet) { | |
if (dataSet.isEmpty()) return; | |
SimpleDateFormat dateFormat = new SimpleDateFormat(); | |
for (DataPoint dp : dataSet.getDataPoints()) { | |
String s = String.format("Data point: %s -> %s %s", | |
dp.getDataType().getName(), | |
dateFormat.format(dp.getStartTime(TimeUnit.MILLISECONDS)), | |
dateFormat.format(dp.getEndTime(TimeUnit.MILLISECONDS))); | |
Log.i(TAG, 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
// ...include external modules | |
def extModuleDir = '../shared_modules' | |
def moduleList = ['mod1', 'mod2'] | |
for (moduleName in moduleList) { | |
def module = ":" + moduleName | |
include module | |
// ...must change projectDir for each module | |
project(module).projectDir = new File(extModuleDir, moduleName) | |
println "- include " + module + " path=" + project(module).projectDir.getPath() |
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
def getCurrGitBranch = { -> | |
try { | |
def code = new ByteArrayOutputStream() | |
exec { | |
commandLine "git", "rev-parse", "--abbrev-ref", "HEAD" | |
standardOutput = code | |
} | |
return code.toString().trim() |
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
def getVersionCode = { -> | |
try { | |
def code = new ByteArrayOutputStream() | |
exec { | |
commandLine "git", "rev-list", "HEAD", "--count" | |
standardOutput = code | |
} | |
return code.toString().toInteger() |