Skip to content

Instantly share code, notes, and snippets.

View ricdex's full-sized avatar
🎯
Focusing

Ricardo Avila ricdex

🎯
Focusing
  • BCP
  • Peru
View GitHub Profile
@ricdex
ricdex / gist:fa9c8c6749f140d75b44
Created March 28, 2016 20:16
SSEmiter con Android
private void startClient() throws InterruptedException {
EventSource es = new EventSource(URI.create("http://192.168.1.43:8080/helloCount"), new EventSourceHandler() {
@Override
public void onConnect() {
System.out.println("CONNECTED");
}
@Override
public void onMessage(String event, MessageEvent message) {
/**
* Copyright 2016 Erik Jhordan Rey.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
@ricdex
ricdex / .gitignore
Created June 22, 2016 17:47 — forked from keyboardsurfer/.gitignore
Android gitignore
# Copyright: Benjamin Weiss (keyboardsurfer) https://github.com/keyboardsurfer
# Under CC-BY-SA V3.0 (https://creativecommons.org/licenses/by-sa/3.0/legalcode)
# built application files
*.apk
*.ap_
*.jar
!gradle/wrapper/gradle-wrapper.jar
# lint folder
@ricdex
ricdex / tomcat_autorestart.sh
Created March 19, 2020 21:52
Iniciar proceso de tomcat si no existe
#!/bin/sh
output=$(ps h -C java -o "%p:%a" | grep catalina | cut -d: -f1)
if [ -z $output ]; then
echo "$(date) - Process not found, need to start"
/opt/tomcat/bin/startup.sh
else
echo "$(date) - Process found, no need to start"
fi
{
"accountId": "19100109502007004",
"formattedAccountNumber": "191-00109502-0-07",
"accountNumber": "19100109502007",
"cci": "225010919303913000",
"productDetail": {
"currency": {
"code": "PEN",
"description": "SOLES"
},