Skip to content

Instantly share code, notes, and snippets.

View alexsc6955's full-sized avatar
馃彔
Working from home

Santiago alexsc6955

馃彔
Working from home
View GitHub Profile
@alexsc6955
alexsc6955 / -margin.styl
Last active September 22, 2021 21:30
Stylus margin mixin
/**
* Name: Stylus -margin mixin
* Description: Mixin to set margins
* Author: Santiago Rinc贸n
* Author URI: http://github.com/rincorpes
* Version: 2.0
* License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
*/
-margin()
@alexsc6955
alexsc6955 / -padding.styl
Last active September 22, 2021 21:30
Stylus padding mixin
/**
* Name: Stylus -padding mixin
* Description: Mixin to set paddings
* Author: Santiago Rinc贸n
* Author URI: http://github.com/rincorpes
* Version: 2.0
* License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
*/
-padding()
@alexsc6955
alexsc6955 / -center.styl
Last active September 22, 2021 21:30
Stylus centered mixin
/**
* Name: Stylus -centered mixin
* Description: Mixin to center elements
* Author: Santiago Rinc贸n
* Author URI: http://github.com/rincorpes
* Version: 2.0
* License: GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
*/
-center()
@alexsc6955
alexsc6955 / html-ie.html
Created March 15, 2017 01:26
Ad a HTML class just for IE || a less robust version putting class on bodyelement
<!DOCTYPE html>
<!--[if IEMobile 7 ]> <html dir="ltr" lang="en-US"class="no-js iem7"> <![endif]-->
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie6 oldie"> <![endif]-->
<!--[if IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie7 oldie"> <![endif]-->
<!--[if IE 8 ]> <html dir="ltr" lang="en-US" class="no-js ie8 oldie"> <![endif]-->
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html dir="ltr" lang="en-US" class="no-js"><!--<![endif]-->
<head></head>
<!--[if IE ]>
@alexsc6955
alexsc6955 / article.html
Created March 15, 2017 01:43
HTML5 article estructure. Example
<article class="post">
<header>
<h1 class="post-title">But Will It Make You Happy?</h1>
<time class="post-updated" datetime="2017-03-14 21:36:03-0400" pubdate>03-14-2017</time>
<p class="post-author">
By <span class="fn">Santiago Rinc贸n</span>
</p>
</header>
<div class="post-content">
@alexsc6955
alexsc6955 / index.html
Created March 15, 2017 02:00
HTML5 Page structure.
<!DOCTYPE HTML>
<html lang="es" class="no-js">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mi p谩gina Web</title>
</head>
@alexsc6955
alexsc6955 / meta.html
Created March 15, 2017 02:04
Meta Tag For Forcing IE 8 to Behave Like IE 7
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
@alexsc6955
alexsc6955 / modal-form.pug
Created March 2, 2020 17:14
modal from pug mixin
mixin modalForm(params)
//- Subscribe Form Moda
.modal.fade(id=params.modalId, tabindex="-1", role="dialog", aria-labelledby=params.modalId, aria-hidden="true")
.modal-dialog.modal-dialog-centered(role="document")
.modal-content
//- Form
form(id=params.form.id, action=params.form.action, method="POST", data-submit=params.form.attrData.submit, data-disable-submition-btn=params.form.attrData.disableSubmitBtn, data-message=params.form.attrData.message)
//- Modal Header
.modal-header
h5.modal-title(id="subscribeFormModalLongTitle") Recibe nuestras notificaciones
@alexsc6955
alexsc6955 / canvas.js
Created April 27, 2021 14:43
Add a custom font to a HTML canvas using javascript
var canvas = document.querySelector('canvas');
// we need this to load the font
var myFont = new FontFace('myFont', 'url(assets/fonts/myFont/myFont.otf)');
myFont.load().then(function(font){
// with canvas, if this is ommited won't work
document.fonts.add(font);
console.log('Font loaded');
@alexsc6955
alexsc6955 / index.js
Created July 6, 2021 02:25
Parse Html Mail Template with node.js replacing string between brackets.
// Require the module
const { parseMailTemplate } = require("./path/to/parseMailTemplate");
// The params we need to pass
const html = '<html lang="es"><head><meta charset="utf-8"><title>Email Verification</title></head><body><h1>Hey, {{ name }}</h1><p>You have just created an account on <strong>{{ company }}</strong>. Please click the following <a href="{{ link }}" target="_blank">link</a> so you can start using your account.</p></body></html>';
const data = {
name: "Jhon Doe",
company: "My awesome company",
link: "http://example.com,
};