Skip to content

Instantly share code, notes, and snippets.

View Yemolai's full-sized avatar
👨‍💻
Working from home

Romulo Gabriel Rodrigues Yemolai

👨‍💻
Working from home
View GitHub Profile
@Yemolai
Yemolai / remote-wsl.md
Created June 20, 2023 19:45 — forked from mattbell87/remote-wsl.md
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Change your OpenSSH shell

SSH to your Windows host (SSH Server must be installed in Windows Features)

ssh user@windowshost
@Yemolai
Yemolai / caixa_modulo_seguranca_macOS.md
Created March 31, 2023 19:59 — forked from binho/caixa_modulo_seguranca_macOS.md
Como instalar/reinstalar o módulo de segurança da Caixa no macOS

Bom vou falar um pouco da minha luta com o Internet Banking da Caixa.

No meu caso tive problemas após migrar o meu macbook para um novo e não conseguia instalar o módulo de segurança no novo macbook e assim sem poder usar o Internet Banking no computador.

Primeiro rodei o script sudo /usr/local/bin/warsaw/uninstall.sh do warsaw como root pra tentar começar tudo do zero mas ainda assim após tentar reinstalar não tive sucesso.

Ao analisar o script postinstall dentro do pkg notei que varios arquivos de inicialização são criados e que alguns dados ainda continuaram no meu computador como certificados e arquivos de inicialização, então tenha certeza que estes arquivos abaixo tenham sido removidos:

rm -f ~/Library/LaunchAgents/com.diebold.warsaw.user.plist
@Yemolai
Yemolai / share-urls.md
Created September 28, 2022 12:45 — forked from apisandipas/share-urls.md
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@Yemolai
Yemolai / sanityCheck.ts
Created March 2, 2022 21:09
This is a Sanity check javascript script to compare values when you think you are going crazy but you just want to confirm
/**
* Compare and write where the difference between strings is
* @param {String} a string to compare
* @param {String} b string to compare
* @returns {String} comparison
*/
function compareStrings(a: string, b: string): string {
if (a.split('').every((c, n) => b.charCodeAt(n) == c.charCodeAt(0))) {
return `\x1b[32m${a} == ${b}\x1b[0m`;
}

When using a Keychron K1 keyboard on Ubuntu 20.10 I found that the Fn keys would not work even switching the fn for the multimedia ones, so I've found that this command can solve this issue:

I managed to get this bug fixed in Ubuntu 20.04 by following this launchpad bug thread. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1814481

Also make sure to get the latest firmware update via windows/mac

Tldr: user Eferox provided the following console command fix

echo 0 | sudo tee /sys/module/hid_apple/parameters/fnmode

from: https://ourcodeworld.com/articles/read/1063/how-to-fix-time-modification-on-your-computer-with-dual-boot-windows-10-and-ubuntu-18-04

How to fix time modification on your computer with dual boot (Windows 10 and Ubuntu 18.04)

FEBRUARY 09 2020

Since i decided to work with dual boot for having an Ubuntu machine with optimal performance, instead of using virtual machines, i noticed that when i started using the computer with Ubuntu and then decided to boot with windows, the timezone of Windows changed automatically, so i needed to fix this everytime i used both operative systems on the same day.

After some research, i discovered what was causing the issue. Apparently, Ubuntu keeps the hardware clock in universal time (UTC), while windows keeps the clock in local time, causing a conflict between the mentioned operative systems.

@Yemolai
Yemolai / email.regex.js
Last active November 25, 2020 20:32
Email format regex validation
/^((?:[^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(?:".+"))@(?:(\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
.test('test@abc.co.jp')
// https://regex101.com/r/wGRDRv/3
@Yemolai
Yemolai / phone.regex.js
Created November 25, 2020 20:07
Brazilian Phone Number Regex (mobile or not with area basic check)
/^(?:(?:\+|00)?(55)\s?)?(?:\(?([1-9][1-9])\)?\s?)?(?:((?:9\s?\d|[2-9])\d{3})\-?(\d{4}))$/.test('(21) 9 9999-9999')
// saved at https://regex101.com/r/R7VO4B/1
// from: https://gomakethings.com/dynamically-changing-the-text-color-based-on-background-color-contrast-with-vanilla-js/
/*!
* Get the contrasting color for any hex color
* (c) 2019 Chris Ferdinandi, MIT License, https://gomakethings.com
* Derived from work by Brian Suda, https://24ways.org/2010/calculating-color-contrast/
* @param {String} A hexcolor value
* @return {String} The contrasting color (black or white)
*/
export function getContrastYIQ (hex) {
// If a leading # is provided, remove it
@Yemolai
Yemolai / - vuejs-sass-environment-variables.md
Created November 18, 2020 00:46 — forked from steveholgado/- vuejs-sass-environment-variables.md
Make environment variables available as Sass variables in Vue.js

Vue.js: Environment variables in Sass

Make environment variables available as Sass variables in Vue.js.