Skip to content

Instantly share code, notes, and snippets.

View MatheusR42's full-sized avatar
🤜
🤛

Matheus Araujo MatheusR42

🤜
🤛
View GitHub Profile
@MatheusR42
MatheusR42 / bluetoothdoubledipping.md
Created May 26, 2024 16:18 — forked from diffficult/bluetoothdoubledipping.md
Bluetooth Pairing one device on Dual Boot of Windows & Linux - Stop having to Pair Devices

Bluetooth Pairing one device on Dual Boot of Windows & Linux - Stop having to Pair Devices

You may have experienced when dual booting that you need to re-pair your bluetooth devices (ie., Headphones, mouse, keyboard, etc) this usually happens because you have already paired the device with another operating system using the same bluetooth adapter when dual booting (either Linux or Windows).

Some devices cannot handle multiple pairings associated with the same MAC address (ie., bluetooth adapter). As per suggested on the ArchWiki you can fix this by re-pairing the device each time, but there's actually another solution to not do so each time you choose to use your device on a different OS.

How can we accomplish this?

Easy, just pair the device on a OS and copy the bluetooth keys generated to the other OS so our device doesn't notice the difference.

@MatheusR42
MatheusR42 / README.md
Created May 5, 2021 15:18
Chaordic/Linx Impulse VTEX checkout tagging
@MatheusR42
MatheusR42 / commands.sh
Created March 10, 2021 00:52
Commands to migrate all branchs and tags to other git server
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done
git fetch --all && git pull --all
git remote set-url origin <repo-url>
git push --all && git push --tags
@MatheusR42
MatheusR42 / cloneAll.js
Created March 10, 2021 00:50
Batch clone repos
const fs = require('fs');
const util = require('util');
const path = require('path');
const exec = util.promisify(require('child_process').exec);
const appDir = path.dirname(require.main.filename);
const repos = [
'git@github.com:MatheusR42/repo-name-1.git',
'git@github.com:MatheusR42/repo-name-2.git',
]
def createTable(variableToChange, graphFunc):
table = []
p = 0.05
n = 300
if variableToChange == "N":
for n in range(100, 1000, 50):
G = erdos_renyi_graph(n, p) if graphFunc == 'erdos_renyi_graph' else watts_strogatz_graph(n, 4, p)
@MatheusR42
MatheusR42 / Buybutton.md
Last active October 26, 2020 14:25
Buybutton

-O buybutton só funciona dentro do contexto de produto da vtex

-O contexto de produto da vtex é bem simples, basta iniciar um contexto no react com o produto no formato do json da vtex

-Infelizmente não vai funcionar nas páginas de search porque o json de produto da chaordic é diferente, por isso vc vai precisar fazer uma validação para não exibir nessas páginas

-Para fazer funcionar na página de search precisariamos fazer uma customização bem grande mexendo com graphql

Passo a passo para exibir o buybutton:

{
"above": "{{field}} deve ser acima de {{argument.0}}.",
"accepted": "{{field}} deve ter sido aceito",
"after": "{{field}} deve ser uma data após {{argument.0}}",
"after_offset_of": "{{field}} deve ser mais recente que {{argument.0}} {{argument.1}} a partir da data atual",
"alpha": "{{field}} deve conter apenas letras",
"alpha_numeric": "{{field}} deve conter apenas letras e números",
"array": "{{field}} deve ser um ARRAY.",
"before": "{{field}} deve ser uma data anterior a {{argument.0}}.",
"before_offset_of": "{{field}} deve ser aterior a {{argument.0}} {{argument.1}} a partir da data de hoje",
{
"above": "The {{field}} should be above {{argument.0}}.",
"accepted": "The {{field}} should have been accepted",
"after": "The {{field}} should be a date after {{argument.0}}",
"after_offset_of": "The {{field}} should be after {{argument.0}} {{argument.1}} from today’s date",
"alpha": "The {{field}} should contain letters only",
"alpha_numeric": "The {{field}} should contain letters and numbers only",
"array": "The {{field}} should be an ARRAY.",
"before": "The {{field}} should be a date before {{argument.0}}.",
"before_offset_of": "The {{field}} should be before {{argument.0}} {{argument.1}} from today’s date",
{
"data": {
"productSearch": {
"products": [
{
"cacheId": "batedeira-stand-mixer-artisan-empire-red-kitchenaid-outlet-kea33-kea30",
"productId": "2002499",
"description": "Um ícone no mundo inteiro!\r\n\r\n\r\n\r\nA Stand Mixer KitchenAid é um ícone mundial de design e performance, presente no MoMA em Nova York.",
"productName": "Batedeira Stand Mixer Artisan Empire Red - Outlet KEA33 KEA30",
"productReference": "KEA33_OUT,KEA30_OUT",
query productSearchV3($query: String, $fullText: String, $selectedFacets: [SelectedFacetInput], $orderBy: String, $from: Int, $to: Int, $hideUnavailableItems: Boolean = false, $skusFilter: ItemsFilter = ALL_AVAILABLE, $simulationBehavior: SimulationBehavior = default, $installmentCriteria: InstallmentsCriteria = MAX_WITHOUT_INTEREST, $productOriginVtex: Boolean = false, $fuzzy: String, $operator: Operator, $searchState: String) {
productSearch(query: $query, fullText: $fullText, selectedFacets: $selectedFacets, orderBy: $orderBy, from: $from, to: $to, hideUnavailableItems: $hideUnavailableItems, simulationBehavior: $simulationBehavior, productOriginVtex: $productOriginVtex, fuzzy: $fuzzy, operator: $operator, searchState: $searchState) {
products {
cacheId
productId
description
productName
productReference
linkText
brand