Skip to content

Instantly share code, notes, and snippets.

View jmserrano-dev's full-sized avatar

José Manuel Serrano Mármol jmserrano-dev

View GitHub Profile
@jmserrano-dev
jmserrano-dev / workflow.yml
Created January 1, 2022 00:47 — forked from AugustoCalaca/workflow.yml
example of workflow ci/cd for monorepo with github actions
name: CI/CD Monorepo
env:
AWS_REGION: us-east-1 # N. Virginia
on:
push:
branches:
- main
paths-ignore:
@jmserrano-dev
jmserrano-dev / resize.js
Created September 24, 2020 08:40 — forked from vishalsrini/resize.js
A simple JavaScript to resize an image and create a blob out of it
window.resize = (function () {
'use strict';
function Resize() {}
Resize.prototype = {
init: function(outputQuality) {
this.outputQuality = (outputQuality === 'undefined' ? 0.8 : outputQuality);
},
@jmserrano-dev
jmserrano-dev / json2declaration.cs
Last active January 13, 2019 23:25
Utils to convert translations files (json format) to Typescript declaration (d.ts) [linq] [script]
////////////// JSON EXAMPLE
// {
// "title": "My title",
// "form": {
// "title": "My form",
// "buttons": {
// "send": "Enviar",
// "cancel": "Cancelar",
// "others": {
// "other": "<>"
using System;
using System.Collections.Generic;
using Wox.Plugin;
namespace WOX.MyPlugin
{
public class Main : IPlugin
{
public void Init(PluginInitContext context)
{
@jmserrano-dev
jmserrano-dev / RenderProps.tsx
Last active October 18, 2018 19:40
RenderProps
import React from "react";
import { render } from "react-dom";
import Styles from "./Styles";
import { Form, Field } from "react-final-form";
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
const onSubmit = async values => {
await sleep(300);
window.alert(JSON.stringify(values, 0, 2));
@jmserrano-dev
jmserrano-dev / Guard.cs
Created August 24, 2018 10:14 — forked from PradeepLoganathan/Guard.cs
C# Guard class with common validation checks.
public static class Guard
{
public static void AgainstNull<T>(T value)
where T : class
{
if (value == null)
throw new ArgumentNullException();
}
public static void AgainstNull<T>(T value, string paramName)
@jmserrano-dev
jmserrano-dev / gist:67cad61c9b75ba1b7489fd23c38ea1bc
Created May 25, 2018 10:24 — forked from lontivero/gist:593fc51f1208555112e0
Generates Markdown from VS XML documentation file
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace GithubWikiDoc
{
#!/bin/bash
MACHINE=$1
# Assume executing in the directory of the Vagrant file
# This command will prompt for the Vagrant user's password, it's usually "vagrant"
ssh-keygen -y -f .vagrant/machines/$MACHINE/virtualbox/private_key | \
vagrant ssh -c "mkdir .ssh; tee -a .ssh/authorized_keys; chmod 0600 .ssh/authorized_keys"

Keybase proof

I hereby claim:

  • I am jmserrano-dev on github.
  • I am jmserrano (https://keybase.io/jmserrano) on keybase.
  • I have a public key ASCxKlPYQ-o3v5GavLpHyHwx1yg9FqzASiu6YUnu-1gSAAo

To claim this, I am signing this object:

From b499a3e00b014f6333eb46e77269a00bdf260f8c Mon Sep 17 00:00:00 2001
From: gttds <ollie.yeoh@gmail.com>
Date: Thu, 16 Jun 2016 23:46:21 +0800
Subject: [PATCH] [System.Web] Fixes 50 year form authentication
This fixes the bug where form authentication tickets do not expire until 50 years later.
I bumped into this bug after upgrading mono from 4.2.2 to 4.4.0
Firstly, the authentication ticket's expiry must always equal to the timeout attribute on the <forms/> element. It doesn't matter whether persistent or session cookies are used.