Skip to content

Instantly share code, notes, and snippets.

View felipe-pita's full-sized avatar
⚒️

Felipe Farias Pita felipe-pita

⚒️
View GitHub Profile
@felipe-pita
felipe-pita / bill-paid.json
Created October 26, 2022 14:19
bill paid
{
"event": "bill_updated",
"data": {
"bill": {
"id": 1,
"bill_api_id": "27394",
"invoice_id": "2758",
"customer_user_id": "925f32d8-fa57-4617-9814-734e6327fd46",
"amount": {
"amount": "3488",
@felipe-pita
felipe-pita / json.json
Last active December 6, 2021 19:22
Exemplo Json Yandeh
{
"id":"771540",
"sellout_timestamp":"2021-07-25T22:46:05",
"origem_coleta":"API|Nerdstore",
"buyer_taxpayer_id":"42144807833",
"store_taxpayer_id":"10640539000401",
"nfe_access_key":"41211210640539000401550010067046991101738505",
"sales_addition":0,
"sales_discount":0,
"total":159.81,
@felipe-pita
felipe-pita / urls.txt
Created March 1, 2021 13:26
Lista de urls para teste de carga
https://nerdstore.com.br/?post_type=product&s=harry+potter
https://nerdstore.com.br/?post_type=product&s=funko
https://nerdstore.com.br/?post_type=product&s=caneca
https://nerdstore.com.br/?post_type=product&s=star+wars
https://nerdstore.com.br/?post_type=product&s=senhor+dos+aneis
https://nerdstore.com.br/?post_type=product&s=mini+busto
https://nerdstore.com.br/?post_type=product&s=cthulhu
https://nerdstore.com.br/?post_type=product&s=ozob
https://nerdstore.com.br/?post_type=product&s=funko+pop
https://nerdstore.com.br/?post_type=product&s=chaveiro
setTimeout(function(){
if ($('body').hasClass('modulo-suprimentos')) {
var name = $('#h_nome_produto').text()
console.log(name);
var sku = $('#h_sku_produto').text();
sku = sku.replace(/"/g, '');
console.log(sku);
<?php
// http://www.example.com/wp-admin/admin-post.php?action=update_all_products
add_action('admin_post_update_all_products', 'update_all_products');
function update_all_products() {
$args = array(
'post_type' => 'product',
'posts_per_page' => 1, // para testar só com 1
);
CREATE TABLE `user` (
`id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`email` varchar(100) NOT NULL,
`password` varchar(255) NOT NULL,
`first_name` varchar(255),
`last_name` varchar(255),
`billing_first_name` varchar(255),
`billing_last_name` varchar(255),
CREATE TABLE `user` (
`id` int(11) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
`email` varchar(100) NOT NULL,
`password` varchar(255) NOT NULL,
`first_name` varchar(255),
`last_name` varchar(255),
`created_at` datetime NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
);
<?php
// Register Custom Taxonomy
function register_product_origem() {
$labels = array(
'name' => 'Origens',
'singular_name' => 'Origem',
'menu_name' => 'Origem',
);
$rewrite = array(
@felipe-pita
felipe-pita / gist:d1513993b9eb0ab97deb830f346a64cb
Created June 19, 2020 12:28
Woocommerce list all products catalog visibility
/**
* Lista a visibilidade do catálogo de todos os itens
*/
add_action('admin_post_check_products_visibility', 'check_products_visibility');
function check_products_visibility() {
$args = array(
'post_type' => 'product',
'posts_per_page' => -1,
);
@felipe-pita
felipe-pita / plp bolada
Created March 17, 2020 01:39
Código de barras
jQuery(function($) {
console.log(window.location.href);
if (window.location.href == 'https://erp.tiny.com.br/expedicao' || window.location.href == 'https://erp.tiny.com.br/expedicao#add') {
console.log('gerando plp');
var position = $('.form-group-section-simple');
var wrapper = $('<div class="form-group-section"> <div class="row"> <div class="col-md-4 form-group"> <div class="input-group search-sale-slip-wrapper"> <span class="input-group-btn"><button class="btn btn-default search-slip-note-indicator" type="button"><i class="fas fa-search"></i></button> </span> </div> </div> </div> </div>');
var input = $('<input class="form-control" placeholder="Pesquisar nota" />');