Skip to content

Instantly share code, notes, and snippets.

View andrefcdias's full-sized avatar
:fishsticks:
fishsticks

André Dias andrefcdias

:fishsticks:
fishsticks
  • Berlin, Germany
  • 01:19 (UTC +02:00)
View GitHub Profile
@andrefcdias
andrefcdias / log-heading-levels.js
Last active October 24, 2023 14:35
Heading level logger
javascript: void (function () {
let result = "";
for (const node of document.querySelectorAll("h1, h2, h3, h4, h5, h6")) {
const label = getNodeValue(node);
if (
!node.closest('[aria-hidden=""], [aria-hidden="true"]') &&
(node.offsetHeight > 0 || node.offsetWidth) &&
label
) {
const headingLevel = parseInt(node.tagName.match(/\d/)[0]);
#Requires -RunAsAdministrator
<# Coolest development environment setup script in the block (Part 2)
---------------------------------------------------------
What can I expect from this script?
Part 2 of the setup script, to be run after rebooting to activate WSL
This will:
#Requires -RunAsAdministrator
<# Coolest development environment setup script in the block
---------------------------------------------------------
Before running the script:
Make sure to run `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process`
before running the script in an admin Powershell session.
See more at https:/go.microsoft.com/fwlink/?LinkID=135170.
@andrefcdias
andrefcdias / setup_git.sh
Last active March 12, 2024 16:50
Setup GitHub's SSH and GPG keys for WSL and ZSH environments
#!/bin/bash
# For WSL environments only
npm install --global yarn
password=""
echo "Please provide your Git commit info"
read -p "Full name: " fullName
read -p "Email: " email
@andrefcdias
andrefcdias / setup_extra.ps1
Last active April 15, 2022 05:42
Extra apps useful to install
winget install "Spotify.Spotify" --accept-package-agreements --accept-source-agreements
winget install "Discord.Discord" --accept-package-agreements --accept-source-agreements
winget install --Id "Mozilla.Firefox" --accept-package-agreements --accept-source-agreements
winget install "7Zip" --accept-package-agreements --accept-source-agreements
winget install "Azure CLI" --accept-package-agreements --accept-source-agreements
# Hoppscotch is unfortunately not available
winget install "Postman" --accept-package-agreements --accept-source-agreements
@andrefcdias
andrefcdias / setup_dev_environment-part-2_DEPRECATED.ps1
Last active March 14, 2022 14:13
To be run after activation of WSL features and reboot (deprecated)
#Requires -RunAsAdministrator
<# Coolest development environment setup script in the block (Part 2)
⚠️ WARNING: This script was created to setup WSL before the new easy installation and was not tested under more recent versions of Windows 11.
Please follow my other guide that uses the new modern installations https://gist.github.com/andrefcdias/e1435ae4458024ece36a3b93e3cdd24f
---------------------------------------------------------
What can I expect from this script?
@andrefcdias
andrefcdias / setup_wsl_environment.sh
Last active October 31, 2022 11:32
Setup a Linux dev environment
#!/bin/sh
# Update and upgrade packages
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
#region ohmyzsh
# Install
sudo apt-get install zsh -y
@andrefcdias
andrefcdias / setup_dev_environment_DEPRECATED.ps1
Last active March 14, 2022 14:13
Making Windows great for Development (deprecated)
#Requires -RunAsAdministrator
<# Coolest development environment setup script in the block (Part 1)
⚠️ WARNING: This script was created to setup WSL before the new easy installation and was not tested under more recent versions of Windows 11.
Please follow my other guide that uses the new modern installations https://gist.github.com/andrefcdias/e1435ae4458024ece36a3b93e3cdd24f
---------------------------------------------------------
Before running the script: