Skip to content

Instantly share code, notes, and snippets.

View victoralvesf's full-sized avatar
🏠
Working from home

Victor Alves victoralvesf

🏠
Working from home
View GitHub Profile
@victoralvesf
victoralvesf / index.js
Created February 12, 2025 12:47
Simple Express Proxy
import express from 'express'
import http from 'http'
import https from 'https'
const app = express()
const PORT = 12720
const setHeaders = (headers) => {
const headersToPass = {
'Content-Type': headers['content-type'] ?? 'application/octet-stream',
@victoralvesf
victoralvesf / docker_ryzentosh.md
Last active March 30, 2025 13:41
Docker no Ryzentosh usando Minikube e VirtualBox.

Como usar o Docker no Ryzentosh pelo Minikube + VirtualBox.

Pre-requisitos

  1. VirtualBox 6.1.40. download
  2. Homebrew. documentação
  3. ProperTree. download
  4. macOS Ventura

Primeiros passos

@victoralvesf
victoralvesf / index.js
Last active January 11, 2022 22:25
[PUPPETEER] - Dealing with new tabs after click in a target _blank anchor.
const puppeteer = require("puppeteer");
async function waitFor(time) {
return new Promise((r) => setTimeout(r, Number(time)));
}
(async () => {
const browser = await puppeteer.launch({
headless: false,
});

Find elements using css selector with expressions:

Example: <input type="text" placeholder="Search..." class="form-control">

How to find this element:

  • By the start string of placeholder

    $('input[placeholder^=Search]') // returns true

[alias]
s = !git status -s
c = !git add --all && git commit -m
l = !git log --pretty=format:'%C(blue)%h%C(red)%d %C(white)%s - %C(cyan)%cn, %C(green)%cr'