Skip to content

Instantly share code, notes, and snippets.

View dan085's full-sized avatar

Daniel dan085

  • Chile
  • 02:21 (UTC -04:00)
View GitHub Profile
@dan085
dan085 / BadgeBarButtonItem.swift
Created October 9, 2021 22:55 — forked from davidlawson/BadgeBarButtonItem.swift
UIBarButtonItem with badge, Swift 4, iOS 9/10/11
import UIKit
public class BadgeBarButtonItem: UIBarButtonItem
{
@IBInspectable
public var badgeNumber: Int = 0 {
didSet {
self.updateBadge()
}
}
//funcion en load_info
fun showMessageOKCancel_one(
ctx: Context,
title: String,
message: String,
okListener: Function1<MaterialDialog, Unit>
): MaterialDialog {
loadInfo.showMessageOKCancel_one_try_again(
context, "Error al cargar información", ---> titulo
"Ocurrio un problema ", ---> descripción
new Function1<MaterialDialog, Unit>() { --> aqui incorporo el listener
@Override
public Unit invoke(MaterialDialog materialDialog) {
AccesoRemoto_Informacion acceso_trasabilidad= new AccesoRemoto_Informacion(AddDataActivity.this);
acceso_trasabilidad.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@dan085
dan085 / log.log
Last active April 22, 2020 00:27
{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhdXRvbWF0b25AY2FyZXlvdS5jbCIsInNjb3BlcyI6WyJURU5BTlRfQURNSU4iXSwidXNlcklkIjoiODVkNzhkOTAtN2YzMi0xMWVhLTlmZWYtZDE5OTJiZjg4YTFhIiwiZmlyc3ROYW1lIjoiQVVUT01BVE9OIiwibGFzdE5hbWUiOiJVU0VSIiwiZW5hYmxlZCI6dHJ1ZSwiaXNQdWJsaWMiOmZhbHNlLCJ0ZW5hbnRJZCI6IjFmZGVkNmIwLTYxNWEtMTFlYS1iOWM3LTA5ZmJhOTI5Y2E0YyIsImN1c3RvbWVySWQiOiIxMzgxNDAwMC0xZGQyLTExYjItODA4MC04MDgwODA4MDgwODAiLCJpc3MiOiJ0aGluZ3Nib2FyZC5pbyIsImlhdCI6MTU4NzUxNDk2MSwiZXhwIjoxNTg3NTIzOTYxfQ.gK6LGLRlHeeHfxnKWuT56ty5-knPADSNGgss9lYBp-yLQyjhnzxCZ8MqnvFE98z-F5LYWlwPId-hxbCa_kEfOA","refreshToken":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhdXRvbWF0b25AY2FyZXlvdS5jbCIsInNjb3BlcyI6WyJSRUZSRVNIX1RPS0VOIl0sInVzZXJJZCI6Ijg1ZDc4ZDkwLTdmMzItMTFlYS05ZmVmLWQxOTkyYmY4OGExYSIsImlzUHVibGljIjpmYWxzZSwiaXNzIjoidGhpbmdzYm9hcmQuaW8iLCJqdGkiOiJmY2FlODU4NC0yN2IzLTRlZTgtYjM2Mi1lY2UyNWI3M2Q1ODQiLCJpYXQiOjE1ODc1MTQ5NjEsImV4cCI6MTU4ODExOTc2MX0.YKWmSBjjwMTLgPuI_Kq3J5dUXYO2Id2WUBWpKf4mZOZtkqaBNmdfXr7LA488NFWENv4tg-AU0r34GDH9gOHPBw","responseCode":"200","message
//// enla linea 95 aparece esta funcion
fun get_access_token_instance(): String {
Log.d("access_token",access_token);
if(access_token.length==0){
try {
this.access_token = a_user_seleted.accessToken
private class AccesoRemoto extends AsyncTask<Void, Void, String> {
private MaterialDialog a;
private Context context;
private static final String SINGULARITY_HOST = "https://cloud.careyou.cl/api/";
private RequestFuture<JSONObject> futureRequest = RequestFuture.newFuture();
public AccesoRemoto(Context context) {
this.context = context;
}
private class AccesoRemoto extends AsyncTask<Void, Void, String> {
private MaterialDialog a;
private Context context;
private static final String SINGULARITY_HOST = "https://cloud.careyou.cl/api/";
private RequestFuture<JSONObject> futureRequest = RequestFuture.newFuture();
public AccesoRemoto(Context context) {
this.context = context;
}
@dan085
dan085 / example.js
Created April 6, 2020 02:43 — forked from millermedeiros/example.js
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});
/ back 버튼 여백 적용 메소드
extension UIImage {
func imageWithInsets(insets: UIEdgeInsets) -> UIImage {
UIGraphicsBeginImageContextWithOptions(
CGSize(width: self.size.width + insets.left + insets.right,
height: self.size.height + insets.top + insets.bottom),
false, self.scale)
guard UIGraphicsGetCurrentContext() != nil else { return UIImage() }
let origin = CGPoint(x: insets.left, y: insets.top)
self.draw(at: origin)
@dan085
dan085 / compareDateTime.kt
Last active February 16, 2020 02:44
comparador de fecha con kotlin
import java.util.*
import java.util.concurrent.TimeUnit
fun main() {
println("Hello, world!!!")
compareDateTime()
}