Skip to content

Instantly share code, notes, and snippets.

View camonunez's full-sized avatar
馃ウ
piumm!

Camilo N煤帽ez camonunez

馃ウ
piumm!
View GitHub Profile
@camonunez
camonunez / Regiones de Chile 2018.js
Last active September 19, 2018 01:24
Regiones de Chile actualizadas al 6 de Septiembre del 2018, con sus provincias y comunas
export default [
{
nombreCompleto: 'Regi贸n de Arica y Parinacota',
prefijo: 'Regi贸n de',
nombre: 'Arica y Parinacota',
romano: 'XV',
numero: '15',
iso_3166_2: 'CL-AP',
provincias: [
{
@camonunez
camonunez / parametrizar.js
Last active November 12, 2021 01:56
Funci贸n para convertir caracteres no usuales en un string usable en urls
const Caracteres = {
LATIN_MAP: { 脌: 'A', 脕: 'A', 脗: 'A', 脙: 'A', 脛: 'A', 脜: 'A', 脝: 'AE', 脟: 'C', 脠: 'E', 脡: 'E', 脢: 'E', 脣: 'E', 脤: 'I', 脥: 'I', 脦: 'I', 脧: 'I', 脨: 'D', 脩: 'N', 脪: 'O', 脫: 'O', 脭: 'O', 脮: 'O', 脰: 'O', 艕: 'O', 脴: 'O', 脵: 'U', 脷: 'U', 脹: 'U', 脺: 'U', 虐: 'U', 脻: 'Y', 脼: 'TH', 脽: 'ss', 脿: 'a', 谩: 'a', 芒: 'a', 茫: 'a', 盲: 'a', 氓: 'a', 忙: 'ae', 莽: 'c', 猫: 'e', 茅: 'e', 锚: 'e', 毛: 'e', 矛: 'i', 铆: 'i', 卯: 'i', 茂: 'i', 冒: 'd', 帽: 'n', 貌: 'o', 贸: 'o', 么: 'o', 玫: 'o', 枚: 'o', 艖: 'o', 酶: 'o', 霉: 'u', 煤: 'u', 没: 'u', 眉: 'u', 疟: 'u', 媒: 'y', 镁: 'th', 每: 'y' },
LATIN_SYMBOLS_MAP: { '漏': '(c)' },
GREEK_MAP: { 伪: 'a', 尾: 'b', 纬: 'g', 未: 'd', 蔚: 'e', 味: 'z', 畏: 'h', 胃: '8', 喂: 'i', 魏: 'k', 位: 'l', 渭: 'm', 谓: 'n', 尉: '3', 慰: 'o', 蟺: 'p', 蟻: 'r', 蟽: 's', 蟿: 't', 蠀: 'y', 蠁: 'f', 蠂: 'x', 蠄: 'ps', 蠅: 'w', 维: 'a', 苇: 'e', 委: 'i', 蠈: 'o', 蠉: 'y', 萎: 'h', 蠋: 'w', 蟼: 's', 蠆: 'i', 伟: 'y', 蠇: 'y', 螑: 'i', 螒: 'A', 螔: 'B', 螕: 'G', 螖: 'D', 螘: 'E', 螙: 'Z', 螚: 'H', 螛: '8', 螜: 'I', 螝: 'K', 螞: 'L', 螠: 'M', 螡: 'N', 螢: '3', 螣:
@camonunez
camonunez / ejemploProveedor.json
Created July 4, 2019 22:17
Ejemplo de un proveedor de Boxmagic
{
"id": "ejemplo",
"nombre": "Gimnasio ejemplo",
"descripcion": "",
"redes": {
"email": "correo@dominio",
"telefono": "+56999999",
"facebook": "https://sasdfsafd",
"twitter": "https://sasdfsafd",
"instagram": "https://sasdfsafd",
import { MongoClient } from 'mongodb'
let cliente
const configs = {
local: {
dbName: 'DatosDev',
url: 'mongodb://user:pass@midominio.com:27017'
},
dev: {
@camonunez
camonunez / regionesChile.js
Created September 21, 2021 19:41
Regiones, Provincias y comunas de Chile
import _ from 'lodash'
const chile = [
{
nombreCompleto: 'Regi贸n de Arica y Parinacota',
prefijo: 'Regi贸n de',
nombre: 'Arica y Parinacota',
romano: 'XV',
numero: '15',
iso_3166_2: 'CL-AP',
@camonunez
camonunez / OsoCoder.vue
Created November 12, 2021 02:04
Componente visual de un Oso Coder animado. No me acuerdo de donde saqu茅 el codigo T.T
<template lang="pug">
.osoCoder
svg(xmlns='http://www.w3.org/2000/svg' viewBox="0 0 300 300")
defs
g(id="code-block").code-block
rect(ry='0' y='862' x='60' height='7.5' width='74')
rect(ry='0' y='874' x='96' height='7.5' width='28')
rect(width='54' height='7.5' x='60' y='886' ry='0')
rect(ry='0' y='897' x='60' height='7.5' width='74')
rect(width='56' height='7.5' x='78' y='909' ry='0')
@camonunez
camonunez / Llavero (WIP)
Last active December 4, 2021 22:22
Clase llavero, para crear y usar para encriptacion y firma
import chalk from 'chalk'
import _ from 'lodash'
import { consolo } from './consolo'
import cripto from './cripto'
class Llavero {
constructor (nombre) {
// console.log('Construcci贸n llavero', nombre)
this.nombre = nombre
@camonunez
camonunez / Cripto
Created December 4, 2021 22:24
Usa implementaci贸n de Webcrypto
import crypto from 'crypto'
import jwt from 'jsonwebtoken'
import { consolo } from './consolo'
const { subtle } = crypto.webcrypto
function btoa (str) { return Buffer.from(str).toString('base64') }
function atob (b64) { return Buffer.from(b64, 'base64').toString() }
function ab2str (buf) { return String.fromCharCode.apply(null, new Uint8Array(buf)) }