Skip to content

Instantly share code, notes, and snippets.

View viceo's full-sized avatar
๐Ÿ‡ฒ๐Ÿ‡ฝ
Working from home

Leopoldo Muรฑoz viceo

๐Ÿ‡ฒ๐Ÿ‡ฝ
Working from home
  • Fermilab
  • Batavia IL
View GitHub Profile
@viceo
viceo / handler.js
Last active January 27, 2024 06:01
Lambda para acceso a RDS dentro de VPC. Incluye el manejo de PREWARM
var mysql = require('mysql2');
var config = require('./config.json');
// var request = require('request');
var pool = mysql.createPool({
host: config.host,
user: config.user,
password: config.password,
database: config.database,
multipleStatements: true
@viceo
viceo / handler.js
Last active May 7, 2021 05:12
[PREWARM] Lambda para mitigar ColdStart usando CloudWatch Log Event (Cronjob)
var aws = require('aws-sdk')
var lambda = new aws.Lambda({ region: 'us-east-1' })
exports.handler = async(event, context) => {
try {
const lambdas = require('./lambdas.json')
const funciones = lambdas.funciones
const payload = JSON.stringify({ PREWARM: true })
const proxy_payload = JSON.stringify({
body: payload,
@viceo
viceo / descargaArchivosEnZip.php
Last active May 7, 2021 05:14
Ejemplo de como crear un ZIP en PHP haciendo uso de AWS-S3
<?php
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;
// Para descargar archivos pesados permitimos usar toda la memoria y aumentamos
// a discreciรณn
ini_set('memory_limit', '-1');
set_time_limit(500);
$uniqueID = uniqid();
@viceo
viceo / md5.cs
Created June 11, 2020 01:55 — forked from madd0/md5.cs
Create an MD5 hash digest in C#
public static string MD5Hash(string toHash)
{
string hashed;
using (MD5 md5 = MD5.Create())
{
hashed = string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(toHash)).Select(b => b.ToString("x2")));
}
return hashed;
@viceo
viceo / simple_args_parsing.sh
Last active June 6, 2020 01:12 — forked from jehiah/simple_args_parsing.sh
a simple way to parse shell script arguments
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@viceo
viceo / multiplePromiseFileUpload.js
Last active May 7, 2021 05:16
Subir multiples archivos en promesa
let _peticionesArchivos = [];
postData.archivos.forEach(archivo => {
let formData = new FormData();
formData.append("comprobante", archivo["$file"]);
// Encolamos peticiones en lista
_peticionesArchivos.push(
axios.post("/archivos", formData, {
headers: {
"Content-Type": "multipart/form-data"
@viceo
viceo / README.md
Created February 13, 2020 17:49 — forked from roachhd/README.md
EMOJI cheatsheet ๐Ÿ˜›๐Ÿ˜ณ๐Ÿ˜—๐Ÿ˜“๐Ÿ™‰๐Ÿ˜ธ๐Ÿ™ˆ๐Ÿ™Š๐Ÿ˜ฝ๐Ÿ’€๐Ÿ’ข๐Ÿ’ฅโœจ๐Ÿ’๐Ÿ‘ซ๐Ÿ‘„๐Ÿ‘ƒ๐Ÿ‘€๐Ÿ‘›๐Ÿ‘›๐Ÿ—ผ๐Ÿ”ฎ๐Ÿ”ฎ๐ŸŽ„๐ŸŽ…๐Ÿ‘ป

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. โœˆ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: ๐Ÿ˜„

@viceo
viceo / Regex RFC
Last active February 26, 2021 21:16
Regex para validar RFC
^([A-Zร‘&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$
@viceo
viceo / project-ideas01.md
Created January 22, 2020 18:31 — forked from MWins/project-ideas01.md
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@viceo
viceo / gist:8352213213b207165d808bb41a46507d
Created June 14, 2019 05:27
Instalar todos los Screensavers en MATE
1) Instalar
apt-get install xscreensaver-data-extra xscreensaver-gl-extra
2) ir a
cd /usr/share/applications/screensavers
3) Cambiar "OnlyShowIn=GNOME;" por "OnlyShowIn=GNOME;MATE;"