Skip to content

Instantly share code, notes, and snippets.

View gabrielqmatos88's full-sized avatar

Gabriel Q. Matos gabrielqmatos88

  • Manaus, Am, Brasil
View GitHub Profile
@gabrielqmatos88
gabrielqmatos88 / wildcard-to-regexp.js
Created November 4, 2022 01:02 — forked from donmccurdy/wildcard-to-regexp.js
Wildcard and glob matching in JavaScript.
/**
* Creates a RegExp from the given string, converting asterisks to .* expressions,
* and escaping all other characters.
*/
function wildcardToRegExp (s) {
return new RegExp('^' + s.split(/\*+/).map(regExpEscape).join('.*') + '$');
}
/**
* RegExp-escapes all characters in the given string.
@gabrielqmatos88
gabrielqmatos88 / udemy.calc.js
Last active May 29, 2022 12:46
Calculate a better avg for udemy courses considering the difference between the total enrolls and total of votes in the course rating, the most part of the courses rating is based in avg 20%0-30% of enrolls
// ==UserScript==
// @name Udemy Calc
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.udemy.com/course/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=udemy.com
// @grant none
// @require https://code.jquery.com/jquery-3.6.0.min.js
@gabrielqmatos88
gabrielqmatos88 / script.js
Last active October 12, 2021 13:17
Consolidando soma dos dados para exibir no gráfico
var data = [
{
x: 'Ala-04',
y: 1
},
{
x: 'Ala-04',
y: 1
},
{
@gabrielqmatos88
gabrielqmatos88 / script.js
Created October 11, 2021 14:03
Tampermonkey - Skip ads (Vuejs) baixar.net
// ==UserScript==
// @name Baixar filmes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.baixarfilmetorrent.net/*
// @match https://www.baixafilme.net/*
// @icon https://www.google.com/s2/favicons?domain=baixarfilmetorrent.net
// @require https://unpkg.com/vue@2.6.14/dist/vue.min.js
@gabrielqmatos88
gabrielqmatos88 / muambator-extender.css
Last active May 14, 2021 19:53
muambator-extender
ul.encomendas {
margin: 0;
padding: 25px 15px;
position: relative;
}
ul.encomendas li {
display: block;
transition-duration: 0.5s;
position: relative;
color: #fff;
@gabrielqmatos88
gabrielqmatos88 / diff.css
Created September 14, 2020 13:44
jsondiff
.jsondiffpatch-delta {
font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-size: 12px;
margin: 0;
padding: 0 0 0 12px;
display: inline-block;
}
.jsondiffpatch-delta pre {
font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', Monaco, Courier, monospace;
font-size: 12px;
@gabrielqmatos88
gabrielqmatos88 / pubsub.js
Created September 13, 2020 15:33 — forked from learncodeacademy/pubsub.js
Basic Javascript PubSub Pattern
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {
this.events[eventName] = this.events[eventName] || [];
this.events[eventName].push(fn);
},
off: function(eventName, fn) {
if (this.events[eventName]) {
@gabrielqmatos88
gabrielqmatos88 / PS1.sh
Last active June 12, 2020 16:15
bash PS1 color format
# without git
#-----------------------------------------------------------------------------------------------------------------------------------------
export PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\e[34;40m\]\u@\h \[\033[35m\]$MSYSTEM\[\033[33m\]\w\[\033[36m\]\[\033[0m\]\n$'
# with git
#-----------------------------------------------------------------------------------------------------------------------------------------
export PS1='\[\033]0;$TITLEPREFIX:$PWD\007\]\n\[\e[34;40m\]\u@\h \[\033[35m\]$MSYSTEM\[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n$'
#-----------------------------------------------------------------------------------------------------------------------------------------
with git green/yellow
#-----------------------------------------------------------------------------------------------------------------------------------------
export PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]\[\033[32m\]\u@\h \[\033[33m\]\w\[\033[36m\]`__git_ps1`\[\033[0m\]\n'
@gabrielqmatos88
gabrielqmatos88 / exemplo1.component.ts
Created January 30, 2020 18:12
Angular components communication using service
import { Component, OnInit } from '@angular/core';
import { NotificationService } from './notification.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class Exemplo1Component implements OnInit {
@gabrielqmatos88
gabrielqmatos88 / app.component.ts
Created January 30, 2020 17:46
Exemplo requisições - angular 8 usando Promise e Observable
import { Component, OnInit } from '@angular/core';
import { OfertasServices, Oferta } from './ofertas.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
title = 'exemplo';