This file contains hidden or 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
class OPHandleError { | |
fun getError(code: Int): Throwable { | |
val messageError: Throwable | |
when (code) { | |
//OpenPay General Errors | |
1000 -> messageError = Throwable("Error interno del servidor") | |
1001 -> messageError = Throwable("Error al identificar usuario, intenta nuevamente") | |
1002 -> messageError = Throwable("Error al identificar usuario, intenta nuevamente") | |
1003 -> messageError = Throwable("La operación no se pudo completar por que el valor de uno o más de los parametros no es correcto") |
This file contains hidden or 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
#start react-native in port 8088 | |
$ react-native start --port=8088 | |
#download the bundle of android know bug in react-native | |
$ curl http://localhost:8088/index.android.bundle?platform=android | |
#inside react-native's android project build the assembleRelease flavor | |
$ ./gradlew assembleRelease | |
#go to the apk's android folder |
This file contains hidden or 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
#ADB enable: | |
adb tcpip 5555 | |
adb connect device-ip:5555 | |
#ADB to disable: | |
adb -s device-ip:5555 usb |
This file contains hidden or 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
public static int getCurrentYear() { | |
return Calendar.getInstance().get(Calendar.YEAR); | |
} | |
public static int[] getMonthsPos() { | |
Calendar calendar = Calendar.getInstance(); | |
calendar.add(Calendar.MONTH, 0); | |
int month1 = new Timestamp(calendar.getTime().getTime()).getMonth(); |
This file contains hidden or 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
Intent intent = new Intent(theContextClass.this, YourClass.class); | |
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK); | |
startActivity(intent); | |
finish(); |
This file contains hidden or 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
//Global Objects and variables | |
ImageView imgBarcode; | |
private static final int WHITE = 0xFFFFFFFF; | |
private static final int BLACK = 0xFF000000; | |
Bitmap bmp; | |
//Implementation | |
bmp = encodeAsBitmap("1234567890", BarcodeFormat.CODE_128, 800, 200); | |
imgBarcode.setImageBitmap(bmp); | |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Cumpleaños</title> | |
<link rel="stylesheet" href="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/css/bootstrap.css" integrity="sha384-XXXXXXXX" crossorigin="anonymous"> | |
<script src="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/js/bootstrap.js" integrity="sha384-XXXXXXXX" crossorigin="anonymous"></script> | |
<link href="assets/css/bootstrap/css/bootstrap.min.css" rel="stylesheet"> | |
<link rel="stylesheet" type="text/css" href="assets/css/estilo.css" > | |
<meta charset="UTF-8"> |
This file contains hidden or 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
func _Dash(text:String) -> String { | |
var modifiedText = "" | |
let textArr = text.componentsSeparatedByString(" ") | |
var repleacetxt = "" | |
for word in textArr { | |
if word != "" { | |
let character = word[word.startIndex] | |
let scalar = String(character).unicodeScalars | |
let unicode = scalar[scalar.startIndex].value | |
if unicode >= 97 && unicode <= 122 { |
This file contains hidden or 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
package com.gorrotowi.btsendreceive; | |
import android.bluetooth.BluetoothAdapter; | |
import android.bluetooth.BluetoothDevice; | |
import android.bluetooth.BluetoothSocket; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.os.Message; | |
import android.support.v7.app.AppCompatActivity; |
This file contains hidden or 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
private final static Pattern EMAIL_ADDRESS_PATTERN = Pattern | |
.compile(/*"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]{1}|[\\w-]{2,}))@" | |
+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" | |
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\." | |
+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?" | |
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|" | |
+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$"*/ | |
"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"); | |
public static boolean isMail(String email) { |