Skip to content

Instantly share code, notes, and snippets.

View puppe1990's full-sized avatar
🚝
Always On Rails!

Matheus Nunes Puppe puppe1990

🚝
Always On Rails!
View GitHub Profile
class SlideStories{constructor(id){this.slide=document.querySelector(`[data-slide="${id}"]`);this.active=0;this.init();}
activeSlide(index){this.active=index;this.items.forEach((item)=>item.classList.remove('active'));this.items[index].classList.add('active');this.thumbItems.forEach((item)=>item.classList.remove('active'));this.thumbItems[index].classList.add('active');this.autoSlide();}
prev(){if(this.active>0){this.activeSlide(this.active-1);}else{this.activeSlide(this.items.length-1);}}
next(){if(this.active<this.items.length-1){this.activeSlide(this.active+1);}else{this.activeSlide(0);}}
addNavigation(){const nextBtn=this.slide.querySelector('.slide-next');const prevBtn=this.slide.querySelector('.slide-prev');nextBtn.addEventListener('click',this.next);prevBtn.addEventListener('click',this.prev);}
addThumbItems(){this.items.forEach(()=>(this.thumb.innerHTML+=`<span></span>`));this.thumbItems=Array.from(this.thumb.children);}
autoSlide(){clearTimeout(this.timeout);this.timeout=setTimeout(this.next,5000);}
@puppe1990
puppe1990 / printOrderDC.js
Created October 12, 2020 19:08
printOrderDC.js
var order_code = [5647, 5648]
for (let index = 0; index <= order_code.length; index++) {
id = order_code[index] + 1
$('.delete').eq(index).attr('name', 'data[Form][selected][' + id + ']')
$('.delete').eq(index).attr('data-id', id)
$('.delete').eq(index).attr('data-pedido', order_code[index])
}
0 < $(".delete:checked").length ? ($("#pedidoViewForm").prop("action", base_url + "venda/pedidos/printOrderDC"), $("#pedidoViewForm").prop("target", "_blank"), $("#pedidoViewForm").submit()) : Backend.modalInfo('<span class="modal-alert-message-content">Nenhum pedido selecionado</span>',
<style type="text/css">img {
max-width: 100%;
display: block;
}
.slide {
max-width: 380px;
margin: 20px auto;
display: grid;
box-shadow: 0 4px 20px 2px rgba(0, 0, 0, 0.4);
}
@xsbr
xsbr / meli_categories_taxes.csv
Created August 13, 2020 17:00
Taxas de Anúncios do MercadoLivre por Categoria - Extraído em 2020-08-13 - Script em https://gist.github.com/xsbr/b586d9f56c0e29c9c12fbb907b535bec
We can't make this file beautiful and searchable because it's too large.
category_id;classico;premium;domain;descricao
MLB122133;11.50;16.50;"MLB-BICYCLE_FORKS";"Esportes e Fitness|Ciclismo|Peças|Suspensões e Garfos|Suspensões e Garfos|Suspensões e Garfos|Suspensões e Garfos"
MLB278141;12.00;17.00;"MLB-METAL_DETECTORS";"Ferramentas e Construção|Ferramentas|Medições e Instrumentação|Detectores de Metais|Detectores de Metais|Detectores de Metais|Detectores de Metais"
MLB431449;11.00;16.00;"MLB-ELECTRONIC_PRODUCTS";"Eletrônicos, Áudio e Vídeo|Áudio|Toca Discos e Acessórios|Toca Discos e Acessórios|Toca Discos e Acessórios|Toca Discos e Acessórios|Toca Discos e Acessórios"
MLB277685;11.00;16.00;"MLB-GAME_CONSOLES_VIDEO_GAMES_AND_ARCADE_MACHINES";"Games|Acessórios para Consoles|Para Xbox|Xbox One|Controles e Joysticks|Controles Remotos Multimídia|Controles Remotos Multimídia"
MLB31039;11.50;16.50;"MLB-POUFS";"Casa, Móveis e Decoração|Móveis para Casa|Pufes|Pufes|Pufes|Pufes|Pufes"
MLB439537;11.00;16.00;"MLB-GAME_CONSOLES_VIDEO_GAMES_AND_ARCADE_MACHINES";"Games|Acessórios para Consoles|
select s.order_code, s.* from sales s
where order_code in ('3374','3375','3502','3496','3457','3534','3258','3393','3429','3381','3398','3059','3333','3408','3184','3268','3392','3360','3351','3372','3361','3473','3465','2673','3509','3449','3470','2816','3362','3414','3355','3388','3487','3380','3474','3377','3456','3364','3441','3467','3341','3280','3244','3390','3199','3336','3263','3483','3189','3468')
order by order_code ;
select * from sales where order_code = '3244';
select pp.store_entrance,pp.* from purchase_products pp
inner join products p2 on p2.id = pp.product_id
where p2.custom_id = '2085' and store_entrance = 2;
select to_char(os.order_date,'YYYY-MM-DD'), sum(value)
from order_stores os
group by to_char(os.order_date,'YYYY-MM-DD')
order by to_char(os.order_date,'YYYY-MM-DD') asc ;
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the wosrld!
// @author You
// @match https://gist.github.com/puppe1990/0cf58e8b4f70c4c39e43d05d40c74739
// @icon https://www.google.com/s2/favicons?domain=github.com
// @grant nonea// ==UserScript==
// @name New Userscript
@sundowndev
sundowndev / GoogleDorking.md
Last active June 20, 2024 10:20
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
(function() {
let size = document.getElementsByClassName("location").length;
let SaoPaulo = ["Rose Rodrigues","marta@.yahoo.com.br","Juliana","Mayara Hermógenes","luciana","Daluy 62 anos","Aline Moura","Arlete silva","Solange Alves","CARLA","Estou precisando de um algo sério quero namorar s...","kelly","Ellen Tatiane","Cristina Maria","Florista_sp","Alê Santos","Jaque","Priscilinha","Carol","Roberto","Paula","Meire Ellen VR","Mary","Mônica","Gabi","wanessa","Néya","maria jose","Cris","Sandra","Andréia","Aneeh Victória","GraSantos","Fabiele gonsalve Gonsalves","Ana Claudia","Ma","Helena","Lika","Maria Santos","Amanda","Marilia","Marina","Andrea","V.... C...","Luana","........","Linda Monteiro","Jaqueline","Giselle","Regina","Amanda","Nazare Magno","Alayna","Marya","Bianca","Moreninha Zl","Cellya","Marcia Oliveira","EPMFA","Cris Santos","Cristina","Vampira Lee","Aninha Ribeiro","milena franca","Ge","Dau Silva","Vanessa Cruz","Marines","Lucia","Mychelle","Ba Xinha","Lany","Rose 50 anos","Sonia","Andressa","G
@simonw
simonw / how-to-upgrade-heroku-postgresql.md
Last active April 29, 2024 05:07
How to upgrade a Heroku PostgreSQL database to a new plan

How to upgrade a Heroku PostgreSQL database to a new plan

I started a project on a Hobby Dev plan (free, limit 10,000 rows), and then later needed to upgrade it to Hobby Basic ($9/month, limit 10,000,000 rows).

After assigning the new database, I had two databases attached to the application. They looked something like this:

  • HEROKU_POSTGRESQL_OLIVE (postgresql-dimensional-3321) Old, free-tier (Hobby Dev) database