Skip to content

Instantly share code, notes, and snippets.

View dan085's full-sized avatar

Daniel dan085

  • Chile
  • 16:04 (UTC -03:00)
View GitHub Profile
@dan085
dan085 / CounterButtonSample.kt
Created October 27, 2024 21:37 — forked from landomen/CounterButtonSample.kt
Animated counter button sample implemented in Jetpack Compose
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
CounterButtonTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
@dan085
dan085 / pregojs.js
Created July 2, 2024 16:49 — forked from lopo12123/pregojs.js
Remove the watermark that comes with gojs
// npm install 之后先使用
// serve-with-gojs/build-with-gojs
// 对 node_module 中相关的文件进行处理
// 去除开源版本的 gojs 自带的水印
const fs = require('fs')
const path = require('path')
const file_js = path.join(__dirname, './node_modules/gojs/release/go.js')
const file_mjs = path.join(__dirname, './node_modules/gojs/release/go.mjs')
const file_module = path.join(__dirname, './node_modules/gojs/release/go-module.js')
@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');
}});