Skip to content

Instantly share code, notes, and snippets.

View lucis's full-sized avatar
🇧🇷
I can't describe what's happening

Lucis lucis

🇧🇷
I can't describe what's happening
View GitHub Profile
@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 / store-block.md
Created March 9, 2020 17:49
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)

@lucis
lucis / mongo_backup.sh
Last active June 14, 2023 20:31
Mongo DB Backup + Gdrive Upload
#!/bin/sh
cd /tmp
FILE=`date +%m%d%y%S`
DEST=mongodb-backup/$FILE.gz
DB_NAME=database-name
# This PARENT_FOLDER is a reference to a Google Drive folder in your account (like, "my-backups").
# Use gdrive list to get the ID of the folder you want
PARENT_FOLDER=186AdURawhC3qJDL7OkGL9ueJmU44pteV
mongodump -d $DB_NAME --archive=$DEST --gzip
@lucis
lucis / useShipping.ts
Created January 10, 2020 12:07
Example of a custom Hook
const useShipping = (sellers: Seller[] = [], skuId: string) => {
const [loading, setLoading] = useState(false)
const [error, setError] = useState<string>(null)
const [estimates, setEstimates] = useState<Sla[]>([])
const { culture } = useRuntime()
const client = useApolloClient()
const getEstimates = (postalCode: string) => {
setLoading(true)
setError(null)
@lucis
lucis / pushingToRepos.ts
Created December 27, 2019 02:27
Creating repositories and pushing files to them using @octokit/rest (GitHub API)
import Octokit from '@octokit/rest'
import glob from 'globby'
import path from 'path'
import { readFile } from 'fs-extra'
const main = async () => {
// There are other ways to authenticate, check https://developer.github.com/v3/#authentication
const octo = new Octokit({
auth: process.env.PERSONAL_ACESSS_TOKEN,
})
@lucis
lucis / .vtex.zsh
Created December 18, 2019 00:04
VTEX + Zsh integration
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"
}
get_vtex_workspace() {
@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",
@lucis
lucis / emails.md
Last active February 25, 2024 14:11
Introdução aos emails institucionais do DPF

E-mails institucionais Deus, Pátria e Família

você@deuspatriaefamilia.com.br

Motivação

  • Uniformizar as plataformas de comunicação do Capítulo
  • Centralizar o armazenamento de Documentos e Planilhas
  • Preservação da história documental da instituição
  • Oferecer aos membros facilidades por participarem de uma organização

Regras