Skip to content

Instantly share code, notes, and snippets.

View DavidAlejandro18's full-sized avatar
🏠
Working from home

David Tovar DavidAlejandro18

🏠
Working from home
  • Proaxis
  • Monterrey, Nuevo Leon, México
View GitHub Profile
@marcomarkkez
marcomarkkez / randomgroups.py
Created November 15, 2022 06:09
Script en Python para dividir tareas en grupos (funciona bien con: tareas = miembros, tareas > miembros, tareas < miembros)
import random
def randGroups():
print("Ingresa los nombres de los miembros o grupos separados por comas")
miembros = input()
print("Ingresa las tareas separadas por coma")
tareas = input()
#print("Miembros: ",miembros)
#print("Tareas: ",tareas)
@bcernesto
bcernesto / animales.php
Last active March 25, 2019 22:48
¿Cómo comprarías 100 animales con 100 pesos si: las vacas cuestan 10 pesos, los borregos cuestan 3 pesos, y los chivos cuestan 50 centavos? Solución en php
<?php
/* Reto propuesto por Whatsapp en el grupo Programando accesible.
Cómo comprarías 100 animales con 100 pesos si:
Las vacas cuestan 10 pesos,
Los borregos cuestan 3 pesos,
Y los chivos cuestan 50 centavos (o céntimos, la moneda no importa)
Para resolverlo se puede tener en cuenta el siguiente sistema de ecuaciones como premisas:
vacas + borregos + chivos = 100 animales
vacas a 10 pesos + borregos a 3 pesos + chivos a 50 centavos = 100 pesos
Debe comprarse al menos un animal de cada tipo.
@Klerith
Klerith / parse-jwt.js
Created March 15, 2018 15:07
Parse - JWT - Obtener Payload y fecha de creación y expiración
function parseJwt (token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace('-', '+').replace('_', '/');
return JSON.parse(window.atob(base64));
};
@OscarAbadFolgueira
OscarAbadFolgueira / conexion-base-datos-mysql.php
Last active October 21, 2022 20:35
Ejemplo de conexión a base de datos en php
<?php
// Ejemplo de conexión a base de datos MySQL con PHP.
//
// Ejemplo realizado por Oscar Abad Folgueira: http://www.oscarabadfolgueira.com y https://www.dinapyme.com
// Datos de la base de datos
$usuario = "root";
$password = "";
$servidor = "localhost";
$basededatos = "alumnos";
@alfchee
alfchee / NumeroALetras.js
Last active June 15, 2024 09:21
Código en JavaScript que convierte números a letras, bastante útil para formularios de documentos contables y similares
/*************************************************************/
// NumeroALetras
// The MIT License (MIT)
//
// Copyright (c) 2015 Luis Alfredo Chee
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@rxaviers
rxaviers / gist:7360908
Last active July 6, 2024 06:25
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@rclark
rclark / Issues.md
Last active January 28, 2024 01:18
Leaflet WMS + GetFeatureInfo

There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:

  1. You have to rely on an AJAX request, this example uses jQuery
  2. To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
  3. Output formats. The info_format parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however.
  4. WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.
git tag -am "annotation goes here" tagname_goes_here # cut a tag
git tag -d tagname_goes_here # burn it
git tag -am "annotation goes here" tagname_goes_here # cut another tag
git push --tags # push tags to remote
git push origin :refs/tags/tagname_goes_here # delete tag from remote