Skip to content

Instantly share code, notes, and snippets.

View pazguille's full-sized avatar

Guille Paz pazguille

View GitHub Profile
@pazguille
pazguille / with-love.html
Created August 9, 2021 03:33
Add “Made with Love” with a Heart to Your Footer
<div>
<style>.made-with-love{font-size: 12px;}.heart{font-style: normal;font-weight: 500;color: #C0392B;}.support-me {background:linear-gradient(to bottom, #ffec64 5%, #ffab23 100%); background-color:#ffec64;border-radius:4px;border:1px solid #ffaa22;display:inline-block;cursor:pointer;color:#333333 !important;font-family:Arial;font-size:12px;line-height:1em;font-weight:bold;padding:6px 10px;text-decoration:none;text-shadow:0px 1px 0px #ffee66;}.support-me:hover {text-decoration:none;}.support-me:active {opacity: .8;}</style>
<p class="made-with-love">Made with <i class="heart" aria-label="love">&#10084;</i> by <a href="https://pazguille.me/">Guille Paz</a> 💸 <a class="support-me" href="https://www.paypal.com/paypalme/pazguille">Support Me!</a></p>
</div>
@pazguille
pazguille / foo.js
Created May 9, 2016 00:13
Asynchronous script loading with initialization
// At the end of the foo.js library we should have something like this:
const foo = document.querySelector('#foo');
if (foo !== null) {
const script = document.createElement('script');
script.innerHTML = foo.innerHTML;
foo.innerHTML = '';
document.body.appendChild(script);
}
@pazguille
pazguille / web-servers.md
Created October 13, 2015 13:37 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@pazguille
pazguille / multi-git.md
Created October 13, 2015 13:25 — forked from rosswd/multi-git-win.md
Setting up a Github and Bitbucket account on the same computer.

Setting up github and bitbucket on the same computer

Github will be the main account and bitbucket the secondary.

Create SSH Keys

ssh-keygen -t rsa -C "github email"

Enter passphrase when prompted. If you see an option to save the passphrase in your keychain, do it for an easier life.

@pazguille
pazguille / index.js
Created February 13, 2015 16:23
JavaScript Blocks
function test(printTwo) {
printing: {
console.log("One");
if (!printTwo) break printing;
console.log("Two");
}
console.log("Three");
}
@pazguille
pazguille / mango-token.html
Last active August 29, 2015 14:14
Mango: Obtener los datos de tarjeta y crear un token.
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Mango</title>
</head>
<body>
<form id="form" action="/your-server" method="POST">
function offline() {
document.body.innerHTML = 'You are offline :(';
}
function online() {
document.body.innerHTML = 'You are online :)';
}
window.addEventListener('load', function(e) {
if (navigator.onLine) {

NodeList vs Array

A NodeList is a reference to a collection of objects, and if that collection changes (for example, elements are added or removed) the NodeList will automatically update to reflect that change; conversely our array is a static snapshot of the collection at one point in time, and so won’t update in response to changes in the DOM. Depending on your application, that could be significant.

Source: Sitepoint

<link rel="shortcut icon" href="favicon.ico">