Skip to content

Instantly share code, notes, and snippets.

View ganobrega's full-sized avatar
:electron:

Gabriel Nobrega ganobrega

:electron:
  • Brazil, São Paulo
View GitHub Profile
@ganobrega
ganobrega / parse_dotenv.bash
Created March 5, 2023 01:08 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@ganobrega
ganobrega / vtex-checkout-events.js
Created October 11, 2022 21:03 — forked from acjr1910/vtex-checkout-events.js
VTEX checkout events
$(window).on('orderFormUpdated.vtex', (event, orderForm) => console.log("orderFormUpdated.vtex"));
$(window).on('orderFormUpdated.vtex', (event, orderForm) => console.log("orderFormUpdated.vtex"));
$(window).on('checkoutRequestEnd.vtex', (event, orderForm) => console.log("checkoutRequestEnd.vtex"));
$(window).on('checkout.vtex.com', (event, orderForm) => console.log("checkout.vtex.com "));
$(window).on('.vtexIdUI', (event, orderForm) => console.log(".vtexIdUI"));
$(window).on('authenticatedUser.vtexid', (event, orderForm) => console.log("authenticatedUser.vtexid"));
$(window).on('started.vtexid', (event, orderForm) => console.log("started.vtexid"));
$(window).on('rendered.vtexid', (event, orderForm) => console.log("rendered.vtexid "));
$(window).on('closed.vtexid', (event, orderForm) => console.log("closed.vtexid"));
$(window).on('guestUser.vtexid', (event, orderForm) => console.log("guestUser.vtexid "));
@ganobrega
ganobrega / checkout-events.js
Created October 11, 2022 21:03 — forked from Juanpablobar/checkout-events.js
VTEX: Checkout events
$(window).on('orderFormUpdated.vtex', (event, orderForm) => console.log("orderFormUpdated.vtex"));
$(window).on('orderFormUpdated.vtex', (event, orderForm) => console.log("orderFormUpdated.vtex"));
$(window).on('checkoutRequestEnd.vtex', (event, orderForm) => console.log("checkoutRequestEnd.vtex"));
$(window).on('checkout.vtex.com', (event, orderForm) => console.log("checkout.vtex.com "));
$(window).on('.vtexIdUI', (event, orderForm) => console.log(".vtexIdUI"));
@ganobrega
ganobrega / store-block.md
Created September 9, 2021 21:27 — forked from lucis/store-block.md
Store Block Summary

Conhecendo uma app VTEX IO

Introdução

Antes de começar, é necessário relembrar alguns conceitos importantes para uma maior compreensão do fluxo lógico ao desenvolver uma app.

manifest.json

vendor

Define o nome da conta VTEX que está desenvolvendo a app. Essa conta é responsável pela manutenção e distribuição da app (pode ser instalada em outras contas ou somente na própria)

@ganobrega
ganobrega / remove-git-tags.sh
Created September 9, 2021 21:26 — forked from lucis/remove-git-tags.sh
Removing ALL git tags for a Repo
git tag -l | xargs git tag -d && git fetch && git tag -l | xargs -n 1 git push --delete origin && git tag -l | xargs git tag -d
@ganobrega
ganobrega / vtex.10s.sh
Created September 9, 2021 21:26 — forked from lucis/vtex.10s.sh
VTEX information to BitBar
#!/bin/bash
TOOLBELT_CFG_FILE="$HOME/.config/configstore/vtex.json"
parse_vtex_json() {
cat "$TOOLBELT_CFG_FILE" | grep $1 | sed -n "s/^.*\"$1\": \"\(.*\)\".*$/\1/p"
}
get_vtex_account() {
parse_vtex_json "account"
}
ACCOUNT=`parse_vtex_json "account"`
WORKSPACE=`parse_vtex_json "workspace"`
@ganobrega
ganobrega / zshrc.sh
Created September 9, 2021 21:25 — forked from lucis/zshrc.sh
Some of my zshrc alias
alias nvim='print -Pn "\e]0;${PWD##*/}-vim\a";nvim'
alias vl='vtex link'
alias vls='vtex ls'
alias vs='vtex switch'
alias vua='vtex unlink --all'
alias vwr='vtex workspace reset'
oni()
{
/Applications/Onivim2.app/Contents/MacOS/Oni2_editor $1 &
@ganobrega
ganobrega / ContextCmder-Disable.reg
Created October 13, 2020 12:03 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7, 8 & 10
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@ganobrega
ganobrega / windows10activation
Created November 11, 2019 06:13
Activate Windows 10 without Any Activator
1. Open CMD as Administrator
2. Paste the following commands into the Cmd: One by one, follow the order.
cscript slmgr.vbs /ipk "SERIAL NUMBER HERE"
Replace SERIAL NUMBER HER with any of these, according your Windows 10 installation type.
Home/Core TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home/Core (Country Specific) PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
Home/Core (Single Language) 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
@ganobrega
ganobrega / stack.cpp
Last active April 25, 2018 19:22 — forked from milon/stack.cpp
Stack Example
//Stack using array
//Author: Milon
//Update: Gabriel
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_ITENS 4