Skip to content

Instantly share code, notes, and snippets.

View phaalonso's full-sized avatar

Pedro Alonso phaalonso

  • Autbank
  • Brazil
View GitHub Profile
@phaalonso
phaalonso / intercept.js
Created February 21, 2022 22:24 — forked from jsoverson/intercept.js
Intercept responses with chrome and puppeteer
const puppeteer = require('puppeteer');
const prettier = require('prettier');
const atob = require('atob');
const btoa = require('btoa');
const scriptUrlPatterns = [
'*'
]
const requestCache = new Map();
@phaalonso
phaalonso / gist:310532cdcd9ba3221a1d0cc276d2b43b
Last active March 11, 2023 19:52
Wezterm error caused by using Wayland on Nvidia GPUs

Error:

16:49:27.140  WARN   wezterm_dynamic::error > `jtab_bar_at_bottom` is not a valid Config field. Did you mean `tab_bar_at_bottom`? There are too many alternatives to list here; consult the documentation!
16:49:27.178  WARN   wezterm_dynamic::error > `jtab_bar_at_bottom` is not a valid Config field. Did you mean `tab_bar_at_bottom`? There are too many alternatives to list here; consult the documentation!
16:49:27.202  WARN   wezterm_dynamic::error > `jtab_bar_at_bottom` is not a valid Config field. Did you mean `tab_bar_at_bottom`? There are too many alternatives to list here; consult the documentation!
[destroyed object]: error 7: failed to import supplied dmabufs: Unsupported buffer format 875713345
16:49:27.288  ERROR  wezterm_gui            > running message loop: error during event_q.dispatch protocol_error=Some(ProtocolError { code: 7, object_id: 0, object_interface: "<unknown>", message: "" }): Protocol error (os error 71); terminating
@phaalonso
phaalonso / settings.json
Last active January 12, 2024 01:41
VSCode
{
"workbench.sideBar.location": "right",
"editor.suggestSelection": "first",
"editor.fontFamily": "'Jetbrains Mono', monospace",
"terminal.integrated.fontFamily": "'Jetbrains Mono', monospace",
"editor.fontLigatures": true, // Enable font ligatures
"editor.fontSize": 13,
"terminal.integrated.fontSize": 13,
// "editor.fontWeight": "500",
// "editor.lineHeight": 20, // Controls the font family.
@phaalonso
phaalonso / logger.ts
Created May 13, 2024 00:01
Easy and beautiful nodejs logger
import pino from "pino";
import pretty from 'pino-pretty'
const stream = pretty({colorize: true});
const logger = pino({
serializers: {
err: pino.stdSerializers.err
},
}, stream);
@phaalonso
phaalonso / .ideavimrc
Last active October 6, 2024 19:52
IntelliJ - Idea VIM
let mapleader=" "
"set clipboard+=unnamed
set clipboard+=unnamedplus
set clipboard+=ideaput
nnoremap \e :e ~/.ideavimrc<CR>
nnoremap \r :action IdeaVim.ReloadVimRc.reload<CR>
nnoremap <leader>z :action ToggleDistractionFreeMode<CR>
@phaalonso
phaalonso / gist:b39de126c70dce49ed82b17178483d93
Created July 17, 2024 16:17
Powershell - cd in git repository chosen with fzf
$projects = 'project dir' (must end with an \ )
function gitRepo {
fd '.git' -H -t d --prune --exclude target --exclude src --exclude logs --exclude node_modules --base-directory $projects | ForEach-Object { $_ -replace '\.git\\','' } | fzf | ForEach-Object { -join($projects, $_) } | cd
}