{
"type": "answer",
"payload": {
"$question_id": "A" // 问题id -> 选项
}
}
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
mvn dependency:tree -Dverbose -Dincludes=com.google.guava |
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
//const tpl = makeTemplate('hello ${name}') | |
//const name = 'world'; | |
//tpl({name}); | |
const makeTemplate = (templateString) => { | |
return (templateData) => new Function(`{${Object.keys(templateData).join(',')}}`, 'return `' + templateString + '`')(templateData); | |
} |
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
insert into red_packet select 3, 20.0 from red_packet having sum(amount) < 10; |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console | |
let f = (a, b) => { return a+b; } |
Q: How to bash source env vars in an env file for docker?
A: In bash, execute commands below:
set -a
[ -f .env ] && . .env
set +a
The app must be debuggable.
Another approach using adb backup
is shown on http://blog.shvetsov.com/2013/02/access-android-app-data-without-root.html
the command for Android 5.0+ to save /data/data/package.name/databases/file would be:
adb exec-out run-as package.name cat databases/file > file
According to this issue https://code.google.com/p/android/issues/detail?id=179600
CoordinatorLayout can't be a container of fragment, otherwise after it is replaced with a fragment, the content might not be shown.
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
#!/usr/bin/env bash | |
branch=`git rev-parse --abbrev-ref HEAD` | |
git push origin -u $branch:branches/$branch $@ |
Android's bad design
- Force context object everywhere in the apis, without guaranteeing the context passed is usable, since every context has their own life cycles. This is a problem especially in asynchronous tasks or callbacks. When methods are called asynchronously, the contexts passed in may not be usable.