Skip to content

Instantly share code, notes, and snippets.

View fourjuaneight's full-sized avatar
🤖

Juan Villela fourjuaneight

🤖
View GitHub Profile
@ithinkihaveacat
ithinkihaveacat / service-worker.d.ts
Last active September 30, 2024 00:18 — forked from tiernan/service-worker.d.ts
Typings for using the Service Worker API with TypeScript
/**
* Copyright (c) 2016, Tiernan Cridland
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
* granted, provided that the above copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
@sergeyklay
sergeyklay / sed-cheatsheet.md
Last active April 8, 2025 06:13
Sed Cheatsheet

Sed Cheat Sheet

Sed command line options

sed [options] sed-command [input-file]
Option Description Example
@LoyEgor
LoyEgor / gulpfile.js
Last active March 13, 2023 17:22
best image compression settings (gulp-imagemin)
// install
// npm i gulp-cache gulp-imagemin imagemin-pngquant imagemin-zopfli imagemin-mozjpeg imagemin-giflossy -f
// node node_modules/jpegtran-bin/lib/install.js
// node node_modules/gifsicle/lib/install.js
// node node_modules/zopflipng-bin/lib/install.js
// node node_modules/mozjpeg/lib/install.js
// node node_modules/giflossy/lib/install.js
// node node_modules/pngquant-bin/lib/install.js
// A clipping object is a JavaScript object that contains the following properties. Properties values may be null.
// title - String
// text - String
// url - String
// saveDate - Date
// Merge function receives an array of clipping objects and returns the merged string
function merge(clippings) {
var merged = clippings.reduce(function(string, clipping) {

The Story of NPM and Yarn

In the beginning there was NPM, and for a time it was good. Packages went forth and multiplied. The New Gods proclaimed the great demon Dependency Management had been slain. But The Old Gods knew better, for they had seen much and knew that the demon can never be killed, only held at bay.

The Old Gods were ignored. In the folly of a young age grew an abundance of packages and with them grew the scourge of dependency. In the depths beneath the earth, in a place beyond memory, the great demon stirred.

The first sign something was wrong was non-deterministic package version mismatches. “This is fine!” The New Gods declared. “A temporary setback, nothing more! We can fix it.” And so they introduced shrinkwrap, a lamp to combat the growing darkness.

But it proved to be too little, too late, and dusk continued to fall. The New Gods suffered their first major defeat at the [Battle of Left-pad](https://www.theregister.co.uk/2016/03/23/npm_left_

@troyfontaine
troyfontaine / 1-setup.md
Last active June 11, 2025 05:03
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

@lattner
lattner / TaskConcurrencyManifesto.md
Last active June 17, 2025 04:35
Swift Concurrency Manifesto
@posener
posener / go-shebang-story.md
Last active June 6, 2025 17:44
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@Piasy
Piasy / install_ffmpeg.sh
Last active June 4, 2025 06:30
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
@carloscabanero
carloscabanero / IBMPlexMono.css
Last active December 8, 2017 19:04
IBMPlex
@font-face {
font-family: "ibm-plex-mono";
font-style: normal;
font-weight: 400;
src: url(data:font/ttf;charset-utf-8;base64,AAEAAAASAQAABAAgRFNJRwAAAAEAAVsIAAAACEdERUYYthiZAAFNGAAAAIJHUE9TPbJ4ZQABTZwAAAToR1NVQt9ERhUAAVKEAAAIhE9TLzKH8WZmAAABqAAAAGBjbWFwrpljkQAADKQAAAieY3Z0IAJODk8AABhcAAAAPmZwZ20GWZw3AAAVRAAAAXNnYXNwABgAIQABTQgAAAAQZ2x5ZgFHeUYAAB3sAAETkGhlYWQLRWVwAAABLAAAADZoaGVhBYgC6QAAAWQAAAAkaG10eMlvp2QAAAIIAAAKnGxvY2Eav2EQAAAYnAAABVBtYXhwBN0DTwAAAYgAAAAgbmFtZS5FQhQAATF8AAAGWXBvc3TDi3HcAAE32AAAFTBwcmVw7506KgAAFrgAAAGiAAEAAAABAABGgo8CXw889QAJA+gAAAAA1VIehQAAAADVUgKh/vz/BQKIBF8AAAAJAAIAAAAAAAAAAQAABAH+7QAAAlj+/P78AogAAQAAAAAAAAAAAAAAAAAAAqcAAQAAAqcAywAiAGkABgABAAAAAAAKAAACAAIZAAMAAQADAlgBkAAFAAACigJYAAAASwKKAlgAAAFeADwBNQAAAgsFCQUAAAAAAKAAAG9QACB7AAAAAAAAAABJQk0gAEAAAPsCAwz/JAEsBAEBEyAAAZMAAAAAAgQCugAAACAAAwJYADIAAAAAAlgAAAJYAAACWABCAlgAPAJYAF8CWABUAlgAPAJYAEMCWABJAlgAQwJYADwCWABDAlgAYgJYAGoCWABdAlgAaQJYAFACWAA2AlgAYgJYAEICWABfAlgAPAJYAE0CWABDAlgAJwJYAFwCWABAAlgAHgJYAD0CWAA1AlgAVQJYAB8CWABYAlg