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
@igorvolnyi
igorvolnyi / flatdir.py
Last active September 25, 2021 13:51
Move or copy files from subdirectories into current directory and remove empty subdirectories (in case of moving)
#! /usr/bin/python
'''
Move or copy files from subdirectories of specified directories into them or into current directory
and optionally remove the empty subdirectories (in case of moving).
TODO: add exception handling.
'''
import sys
@lucis
lucis / zshrc.sh
Created May 27, 2020 18:20
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 &
@lucis
lucis / vtex.10s.sh
Created April 6, 2020 12:32
VTEX BitBar plugin (with color support)
#!/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"`
@lucis
lucis / vtex.10s.sh
Last active September 9, 2021 21:26
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"`
@lucis
lucis / remove-git-tags.sh
Created April 3, 2020 17:42
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
import {
ExternalClient,
InstanceOptions,
IOContext,
} from '@vtex/api'
import {
ReposGetResponse,
UsersGetByUsernameResponse,
GitCreateTagParams,
@lucis
lucis / how-to.md
Created December 17, 2019 17:21
How to implement a custom challenge on VTEX Store Framework

How to create a custom challenger on VTEX Store Framework

  • We have a couple challenges of our own, like ProfileChallenge, but this recipes shows how to create a custom one that you can use anywhere in your store.

1. Create the following interfaces

{
  "b2b-challenge": {
    "component": "Challenge",
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
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)
@vitorbritto
vitorbritto / add_php_brew.md
Last active September 26, 2018 14:19
Install PHP with HomeBrew

Install PHP with HomeBrew

Complete Guide / Isseus / Common Problems: https://github.com/Homebrew/homebrew-php

Installing PHP 5.6

# Install PHP with PHP-FPM and excluding snmp
brew install -v homebrew/php/php56 --with-fpm --without-snmp

Setting up PHP 5.6

@vitorbritto
vitorbritto / rm_mysql.md
Last active November 5, 2024 05:41
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql