Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View matheusmurta's full-sized avatar
👨‍💻
Focusing

Matheus Gonçalves Murta matheusmurta

👨‍💻
Focusing
View GitHub Profile
<!-- TWO STEPS TO INSTALL PREGNANCY CALCULATOR:
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
@matheusmurta
matheusmurta / gist:34eb28e003b953e17a937c6c9dcb6852
Created October 5, 2021 17:01
angular 2+ currency pipe programmatically
//angular 2+ currency pipe programmatically
getFormattedPrice(price: number) {
return new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(price);
}
@matheusmurta
matheusmurta / gist:c50d3001664e2353f0bf9908eb8c9298
Last active September 1, 2021 17:06
Directive to detec end of scroll angular material
import { Directive, HostListener, Output, EventEmitter } from '@angular/core';
@Directive({
selector: '[scrollTracker]',
})
export class ScrollTrackerDirective {
@Output() scrolled = new EventEmitter<any>();
@HostListener('scroll', ['$event'])
onScroll(event) {
@matheusmurta
matheusmurta / gist:5324db8631e9c4f7dcf9070e87fb5577
Created November 7, 2020 22:14
Tinder Auto Like Javascript
var confirmBox = confirm('Start swiping right?');
var count = 1;
var like = function(){
if (confirmBox){
document.querySelector('[aria-label="Gosto"]').click(); //translate you country inspect the button
console.log('Liked ' + count); count++; };
setTimeout(like, 100);
};
setTimeout(like, 100);
@matheusmurta
matheusmurta / AngularDirectivesSamples.ts
Last active October 14, 2020 17:25
Angular Useful Directives Samples
(ngModelChange)=
[(ngModel)]
(blur)=
(keyup)=
(click)=
(focus)=
*ngFor="let option of options | async"
*ngIf="xxxx"
<td>{{ product?.productName }}</td>
@matheusmurta
matheusmurta / Popover Inspiration
Created August 4, 2020 14:23
Popover Inspiration
https://scripts-cdn.softpedia.com/screenshots/WebUI-Popover_1.png
https://developer.apple.com/design/human-interface-guidelines/macos/images/popover_2x.png
https://i.pinimg.com/originals/c8/9d/26/c89d26693202223e22a296a4cc32cb3e.png
https://cdn.dribbble.com/users/5477/screenshots/1867310/helpscout-conversation-popover.png
@matheusmurta
matheusmurta / Padrão de estrutura SCSS DICAS
Created July 30, 2020 16:46
Padrão de estrutura SCSS DICAS
Padrão com Atomic Design
https://webdesign.tutsplus.com/articles/structuring-sass-saying-goodbye-to-atomic-design-ambiguity--cms-26679
https://blog.prototypr.io/organized-scss-folder-structures-for-design-systems-ecb861f1522c
Padrão 7-1 recomendado pelo proprio site do sass
https://sass-guidelin.es/#the-7-1-pattern => exemplo https://gist.github.com/rveitch/84cea9650092119527bc
@matheusmurta
matheusmurta / ES6 Destructuring
Created July 15, 2020 04:32
ES6 Destructuring
const student = {
name: 'John Doe',
age: 16,
scores: {
maths: 74,
english: 63
}
};
// We define 3 local variables: name, maths, science
@matheusmurta
matheusmurta / Filtrar itens de um array baseado no conteudo da key
Created July 15, 2020 03:36
Filtrar itens de um array baseado no conteudo da key
Filtrar itens de um array baseado no conteudo da key
var PATTERN = 'bedroom',
filtered = myArray.filter(function (str) { return str.includes(PATTERN); });
ou
var PATTERN = 'La';
const filtered = users.results.filter((obj) =>
obj.name.first.includes(PATTERN) || obj.name.last.includes(PATTERN)
);
@matheusmurta
matheusmurta / Get all href of specif div
Created July 2, 2020 02:33
Get all href of specif div
Array.prototype.map.call(document.querySelectorAll("body > div.container-fluid.falco-custom-fluid-container > div > div > div > div:nth-child(1) > a"), function (e) {
return e.getAttribute('href');
});
Array.prototype.map.call(document.querySelectorAll(".myselectorAreaofLinks"), function (e) {
return e.getAttribute('href');
});