Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Dario Garcia dario61081

🎯
Focusing
View GitHub Profile
@dario61081
dario61081 / numero_letras.py
Last active Mar 26, 2020 — forked from efrenfuentes/numero_letras.py
Numero a letras (Python)
View numero_letras.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'efrenfuentes'
MONEDA_SINGULAR = 'guarani'
MONEDA_PLURAL = 'guaranies'
CENTIMOS_SINGULAR = 'centimo'
@dario61081
dario61081 / table.vue
Last active Jul 16, 2019
vue.js render multiple tr
View table.vue
<template v-show="datos" v-for="item, index in datos">
<tr :key="index">
<td class="date">[[item.fecha|todate]]</td>
<td>[[item.numero]]</td>
<td class="codigo">[[item.cuenta_codigo]]</td>
<td class="text-ellipsis" :title="item.descripcion">[[item.descripcion]]</td>
<td class="number">[[item.cotizacion|tonumber]]</td>
<td class="number">[[item.debe1|number]]</td>
<td class="number">[[item.haber1|number]]</td>
<td class="number">[[item.debe2|tonumber]]</td>
@dario61081
dario61081 / servidor_video.py
Created Apr 20, 2019
Servidor de video desde la webcam
View servidor_video.py
import cv2
from flask import *
class Camera:
def __init__(self, index):
self.index = index
self.cap = cv2.VideoCapture(0)
@dario61081
dario61081 / conexion.py
Created Apr 20, 2019
Clase para conexion con base de datos OpenSource MIT
View conexion.py
#!/usr/bin/python
# Libreria de conexion a base de datos
# Autor: Dario R. Garcia G. DR2GSistemas
# Villeta - Paraguay
#
# Version: 1.02
# - Agregado runtime exception
# Version: 1.01
# - Bug fix: control de host y port
# Version: 1.00
@dario61081
dario61081 / GetUnsafeOkHttpCliente.java
Created Apr 17, 2019
Funcion para utilizar con https y aceptar todos los certificados
View GetUnsafeOkHttpCliente.java
public static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public void checkClientTrusted( java.security.cert.X509Certificate[] chain, String authType ) {
}
@Override
@dario61081
dario61081 / Threads.py
Created Apr 12, 2019
gestor de descarga de rucs
View Threads.py
import os
from datetime import datetime
from threading import Thread
from zipfile import ZipFile
import requests
class ThreadRUCDownloader(Thread):
"""Clase para descargar los archivos zip de la pagina"""
@dario61081
dario61081 / tools.py
Created Apr 12, 2019
timing de funciones en python
View tools.py
from functools import wraps
from time import time
def timing(f):
@wraps(f)
def wrapper(*args, **kwargs):
start = time()
result = f(*args, **kwargs)
end = time()
@dario61081
dario61081 / rucs.py
Created Apr 12, 2019
Actualizacion de rucs
View rucs.py
import os
import threading
import zipfile
import requests
class DownloadRUC(threading.Thread):
__index = 0
__version = 0
@dario61081
dario61081 / gulpfile.js
Last active Nov 10, 2019
crear bundle file
View gulpfile.js
/*
* Copyright (c) 2019.
* Este software ha sido desarrollado por DR2GSistemas, Orex es una plataforma base para construccion de aplicaciones web tipo gestion, basado en python y flask como framework principal. ademas en conjunto con otros plugins a fin de brindar la mejor base para desarrollo de software estable, confiable y rapida.
*
* Programador: Dario R. Garcia G. <dario61081@gmail.com>
* Villeta - Paraguay
*/
/**
* GulpFile DR2GSistemas v1.4
@dario61081
dario61081 / restart.java
Created Apr 10, 2019
Reiniciar aplicacion
View restart.java
public static void restart(Context context) {
PackageManager packageManager = context.getPackageManager();
Intent intent = packageManager.getLaunchIntentForPackage(context.getPackageName());
ComponentName componentName = intent.getComponent();
Intent mainIntent = Intent.makeRestartActivityTask(componentName);
context.startActivity(mainIntent);
System.exit(0);
}