Skip to content

Instantly share code, notes, and snippets.

Gabriel Reitz Giannattasio gartz

Block or report user

Report or block gartz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gartz
gartz / HtmlWebpackPlugin_templateEngine.js
Created Aug 16, 2019
HtmlWebpackPlugin_templateEngine is a very simple template engine made for HtmlWebpackPlugin, so you can use native js template string to generate the HTML files.
View HtmlWebpackPlugin_templateEngine.js
const optionalCloseTags = ['link', 'meta', 'br'];
const serializeAttributes = (attributes) => Object.entries(attributes).map(([key, value]) => {
if (typeof value === 'boolean') {
return value ? key : '';
}
return `${key}="${value}"`
}).join(' ');
const html = (strList, ...args) => strList.reduce(
@gartz
gartz / justdoit
Created Aug 13, 2019
replace sudo by justdoit and give you a motivational speech when stdout/stderr
View justdoit
#!/bin/bash
declare -a keepTrying=("Yesterday you said tomorrow"
"Don't let your dreams be dreams"
"And you're not going to stop there"
"No, what are you waiting for?")
declare -a youDidIt=("You should get to the point where anyone else would quit"
"Make your dreams come true"
"Nothing is impossible"
View no-babel
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
</head>
<body>
<div id="root"></div>
View ReactElement-production.js
/**
* Copyright 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
View bind-test.js
// Begin with:
delete Function.prototype.bind;
function bind(/* ... */){
/* ... */
}
// Ends with:
Function.prototype.bind = bind;
You can’t perform that action at this time.