Skip to content

Instantly share code, notes, and snippets.

View auginator's full-sized avatar

Agustin Sevilla auginator

View GitHub Profile
@richtr
richtr / config.yml
Last active November 28, 2017 21:36
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@davidgilbertson
davidgilbertson / http2.js
Last active October 9, 2023 06:09
HTTP2 server with compression and caching
const http2 = require('http2');
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const brotli = require('brotli'); // npm package
const PORT = 3032;
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/');
const cache = {};
@WebReflection
WebReflection / why-i-use-web-components.md
Last active December 5, 2023 17:47
Why I use web components

Why I use web components

This is some sort of answer to recent posts regarding Web Components, where more than a few misconceptions were delivered as fact.

Let's start by defining what we are talking about.

The Web Components Umbrella

As you can read in the dedicated GitHub page, Web Components is a group of features, where each feature works already by itself, and it doesn't need other features of the group to be already usable, or useful.

class MyEventEmitter {
constructor() {
this._events = {};
}
on(name, listener) {
if (!this._events[name]) {
this._events[name] = [];
}
@erelson
erelson / gist:35a23ac28aa800af9a06ba7822afdaa7
Created August 13, 2021 05:04
Set an email when cloning repos
# Use this with a git alias like `cl = "!sh ~/clone_helper.sh"`
# A bash function to replace `git clone` could also be done
# like in https://stackoverflow.com/a/39357426/999505
set -e
if [ $# = 0 ]; then # forgot to pass anything, d'oh
echo ERROR Must pass repo path to clone
exit 1
fi