Skip to content

Instantly share code, notes, and snippets.

View nucliweb's full-sized avatar

Joan León nucliweb

View GitHub Profile
@nucliweb
nucliweb / Install-OpenCV-Mac-M1.md
Last active March 6, 2024 10:18
OpenCV C++ Mac M1 Installation Steps
@nucliweb
nucliweb / js-terms.md
Created January 24, 2016 09:13 — forked from AllThingsSmitty/js-terms.md
10 terms to help you better understand JavaScript

10 JavaScript Terms You Should Know

From currying to closures there are quite a number of special words used in JavaScript. These will not only help you increase your vocabulary but also better understand JavaScript. Special terms are normally found in documentation and technical articles. But some of them like closures are pretty standard things to know about. Knowing what the word itself means can help you know the concept it's named for better.

  1. Arity
  2. Anonymous
  3. Closure
  4. Currying
  5. Hoisting
  6. Mutation
@nucliweb
nucliweb / Switch-Node-Version.sh
Last active October 6, 2023 15:42
Zsh script to switch to Node defined in the .nvmrc file.
# place this after nvm initialization!
autoload -U add-zsh-hook
load-nvmrc() {
local nvmrc_path
nvmrc_path="$(nvm_find_nvmrc)"
if [ -n "$nvmrc_path" ]; then
local nvmrc_node_version
nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
@nucliweb
nucliweb / Image-Video-Optimization.md
Last active September 21, 2023 07:26
Twitter accounts you should follow if you like Image & Video Optimization
@nucliweb
nucliweb / function.sh
Created September 15, 2023 21:49
List and select npm scripts
## Requisites
## fzf https://github.com/junegunn/fzf
## jq https://jqlang.github.io/jq/
_nr () {
local cmd
local TASK=$(npm run | egrep '^\s' | awk '{gsub(/ /,""); print}' | awk 'NR%2==1' | fzf --preview 'jq .scripts package.json' | awk '{gsub(/ /,""); print}')
if [ -n "$TASK" ]; then
cmd="npm run \"$TASK\""
eval "$cmd" &
@nucliweb
nucliweb / rust-command-line-utilities.markdown
Created September 6, 2023 19:20 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@nucliweb
nucliweb / Styleguides.md
Created December 17, 2015 18:50
Styleguides

Tipos de Guias de estilo

  • Content & editorial style guides
  • Branding & identity style guides
  • Development style guides & coding standards
  • Human Interface Guidelines
  • Frontend style guides

Content & editorial style guides

@nucliweb
nucliweb / ffmpeg-mp4-to-animated-webp.md
Created August 10, 2023 05:24 — forked from witmin/ffmpeg-mp4-to-animated-webp.md
Convert MP4 file to animated WebP in ffmpeg

Convert MP4 file to animated WEBP file in ffmpeg CLI

1. Install ffmpeg CLI through homebrew

In terminal.app, install ffmpeg through homebrew

brew install ffmpeg

Validate the installation:

@nucliweb
nucliweb / slugify.js
Created July 23, 2015 07:08
Javascript Slugify
// from https://gist.github.com/mathewbyrne/1280286
function slugify(text) {
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@nucliweb
nucliweb / CumulativeLayoutShiftBookmarklet.js
Last active February 13, 2023 07:53 — forked from anniesullie/CumulativeLayoutShiftBookmarklet.js
Bookmarklet for showing Cumulative Layout Shift
/**
* A bookmarklet for viewing shifted elements while debugging
* Cumulative Layout Shift (web.dev/cls). Works in Chrome 84+
* Shows the previous position of shifted elements in yellow,
* and the new position in red.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/