Skip to content

Instantly share code, notes, and snippets.

View nucliweb's full-sized avatar

Joan León nucliweb

View GitHub Profile
@nucliweb
nucliweb / Pull-over-all-subdirectories.md
Last active December 27, 2022 14:58
Run pull origin master over all subdirectories

Update all the repositories in a folder (Mac OS X & Linux)

This command updates the repositories in all subfolders inside a folder.

⚠️ The script updates the current banch in each folder.

For e.g. run in code folder to update respositories in all the subfolders

/code
@nucliweb
nucliweb / Network-Throttling.md
Last active November 25, 2022 22:34
Network Throttling Profile

Throttling

Network Throttling Profile

Network Download (kbit/s) Upload (kbit/s) Latency (ms)
3G | 3G (Basic) 307.2 102.4 0
3G | HSPA 7372.8 1536 0
3G | HSPA+ 21504 4096 0
3G | DC-HSPA+ 43008 8192 0
@nucliweb
nucliweb / download_all_branches.sh
Created September 18, 2022 17:47 — forked from doulmi/download_all_branches.sh
Download All branches
#!/bin/bash
set -x #echo on
remote_url=$(git config --get remote.origin.url)
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
branch_name=$(echo $branch| cut -d'/' -f 3)
git clone -b $branch_name $remote_url $branch_name
done
@nucliweb
nucliweb / CSS-Tools.md
Last active July 4, 2022 16:46
CSS Tools
@nucliweb
nucliweb / gist:f984b9fc75a1c82ef1a1
Last active June 29, 2022 09:26
Sublime Text 3 on OS X Terminal

Sublime Text 3 on OS X Terminal

By creating link

Linking into /usr/bin with sudo:

$ sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/sbl
const puppeteer = require("puppeteer");
// const crawlPage = require("./crawl-urls");
const PAGE_URL = process.argv[2] || "https://pptr.dev";
const bytesToSize = (bytes, decimals = 2) => {
if (bytes === 0) return "0 Bytes";
const k = 1024;
const dm = decimals < 0 ? 0 : decimals;
@nucliweb
nucliweb / WebPerfMetrics.md
Last active May 6, 2022 06:53
Web Performance Metrics
@nucliweb
nucliweb / fortune-cowsay-lolcat.md
Last active April 3, 2022 01:22
fortune | cowsay | lolcat

fortune | cowsay | lolcat

Install Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install fortune

brew search fortune
@nucliweb
nucliweb / LCP.js
Created March 19, 2022 09:23
Get LCP Metrics
/**
* PerformanceObserver
*/
const po = new PerformanceObserver(list => {
let entries = list.getEntries();
entries = dedupe(entries, "startTime");
/**
* Print all entries of LCP
@nucliweb
nucliweb / list-link-rels.js
Created August 31, 2021 08:30
Snippet to list the link elements with some web performance "rel" attribute