Skip to content

Instantly share code, notes, and snippets.

for filepath in $(find . -name '*.png')
do
case $filepath in
*/[0-9].png)
file="ic_weather_0$(basename $filepath)"
path=${filepath%/*}
echo "$filepath > $path/$file"
mv $filepath "$path/$file"
;;
public static void main(String[] args) throws InterruptedException {
AtomicInteger a = new AtomicInteger();
Observable<Object> objectObservable = Observable.create(subscriber -> {
new Thread(() -> {
while(true) {
int i = a.incrementAndGet();
try {
Thread.sleep(4 * 1000);
#run build and git rebase and verify all commits
while ./gradlew testProdReleaseUnitTest && git rebase --continue; do echo 'ok'; done;
#rebase my branch
git rebase -i origin/master
https://github.com/googlesamples/android-architecture/tree/todo-mvvm-databinding/todoapp/app/src/main/res
https://github.com/googlesamples/android-architecture/tree/todo-mvvm-databinding/todoapp/app/src/main/res/layout
https://github.com/antoniolg/androidmvp/tree/master/app/src/main/java/com/antonioleiva/mvpexample/app/main
https://antonioleiva.com/mvp-android/
survive changes / lifecycle aware:
http://blog.bradcampbell.nz/mvp-presenters-that-survive-configuration-changes-part-2/
https://github.com/teegarcs/RetroRx/blob/master/app/src/main/java/com/captech/retrorx/NetworkService.java
https://www.captechconsulting.com/blogs/a-mvp-approach-to-lifecycle-safe-requests-with-retrofit-20-and-rxjava
https://medium.com/google-developers/making-loading-data-on-android-lifecycle-aware-897e12760832
@tszpinda
tszpinda / jenkins-nexus-artifact-versions.groovy
Created September 5, 2017 10:29
find artifact versions in nexus and sort
def url = '.../maven-metadata.xml'
def metadataText = "curl ${url}".execute().text
def parser = new XmlParser();
def xml = parser.parseText(metadataText);
def versions = []
xml.'**'.version.each { v ->
versions.add(v.text())
}
@tszpinda
tszpinda / visual-studio-keys.json
Created August 16, 2017 11:18
visual studio keys config
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "f3",
"command": "editor.action.goToDeclaration",
"when": "editorHasDefinitionProvider && editorTextFocus && !isInEmbeddedEditor"
},
{
"key": "f12",
"command": "-editor.action.goToDeclaration",
@tszpinda
tszpinda / visual-studio-config.json
Created July 28, 2017 07:53
visual studio config
// Place your settings in this file to overwrite the default settings
{
"workbench.colorTheme": "Quiet Light",
"editor.fontSize": 13,
"editor.renderWhitespace": "boundary",
"editor.formatOnType": true,
"editor.formatOnPaste": true,
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
"workbench.colorCustomizations": {
@tszpinda
tszpinda / twitt.json
Created April 28, 2017 09:11
random json file
{
"created_at":"Thu Apr 27 12:54:39 +0000 2017",
"id":857578741438066688,
"id_str":"857578741438066688",
"text":"RT @marianawhispers: Nunca he podido entender c\u00f3mo el amor propio en muchas mujeres va mucho despu\u00e9s del amor a un hombre.",
"source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e",
"truncated":false,
"in_reply_to_status_id":null,
"in_reply_to_status_id_str":null,
"in_reply_to_user_id":null,
@tszpinda
tszpinda / jenkins-pipeline-input.groovy
Created January 16, 2017 09:58
Jenkins 2 pipelie input example
stage('UA') {
echo 'start'
def answer = userWantToKeepCluster()
echo "will keep cluster? $answer"
echo 'done'
}
def userWantToKeepCluster() {
try {
timeout(time: 1, unit: 'MINUTES') {
def keep = input message: 'Keep cluster?',
@tszpinda
tszpinda / jenkins-ansible-console-check.groovy
Last active December 6, 2016 13:18
ansible-jenkins check
import jenkins.*
import jenkins.model.*
import hudson.*
import hudson.model.*
def jobNameStartsWith = 'cp16-dataengine-gerrit'
Jenkins.instance.items.findAll { it.displayName.startsWith(jobNameStartsWith) }
.each { job ->
job.builds.findAll { it.isBuilding() }.each { build ->