Skip to content

Instantly share code, notes, and snippets.

View tosipaulo's full-sized avatar
🤓

Paulo Tosi tosipaulo

🤓
View GitHub Profile
@tosipaulo
tosipaulo / CountDown.js
Created May 3, 2018 20:25
CountDown.js
/**
* CountDown
*/
const msDateCountDown = 1525303846754; //Aqui vc pega o milesegundo atual usando new Date().getTime()
let dateCountDown = new Date(msDateCountDown);
dateCountDown.setMinutes(dateCountDown.getMinutes() + 8);
dateCountDown = dateCountDown.getTime();
let intervalDate;
const formatSeconds = (seconds) => {
@tosipaulo
tosipaulo / array_dupplicate_counter.js
Created December 21, 2017 22:46 — forked from ralphcrisostomo/array_dupplicate_counter.js
Javascript: Count duplicates in an array
/**
Problem:
You have a javascript array that likely has some duplicate values and you would like a count of those values.
Solution:
Try this schnippet out.
*/
@tosipaulo
tosipaulo / regexp.js
Created December 21, 2017 00:53
Replace RegExp String
const regExp = /\[audiouol][0-9]{4,}\[\/audiouol\]/g;
let string = '<p><img src="http://imagem.band.com.br/novahome/17b44db0-8a3f-40c1-8d7d-9931c8a213ff.jpg" />[audiouol]234234[/audiouol]</p> [audiouol]9999999999999999999[/audiouol]<p><img src="http://adm.band.com.br/bd_images/files/real/50/f_16350.jpg" /></p>[audiouol]234234[/audiouol]<p>Lorem impsum teste aqui</p>';
/*
* output: ["[audiouol]234234[/audiouol]", "[audiouol]9999999999999999999[/audiouol]", "[audiouol]234234[/audiouol]"]
*/
const resultRegExp = string.match(regExp)
resultRegExp.map(item => {
@tosipaulo
tosipaulo / regexp.js
Created December 21, 2017 00:53
Replace RegExp in String
const regExp = /\[audiouol][0-9]{4,}\[\/audiouol\]/g;
let string = '<p><img src="http://imagem.band.com.br/novahome/17b44db0-8a3f-40c1-8d7d-9931c8a213ff.jpg" />[audiouol]234234[/audiouol]</p> [audiouol]9999999999999999999[/audiouol]<p><img src="http://adm.band.com.br/bd_images/files/real/50/f_16350.jpg" /></p>[audiouol]234234[/audiouol]<p>Lorem impsum teste aqui</p>';
/*
* output: ["[audiouol]234234[/audiouol]", "[audiouol]9999999999999999999[/audiouol]", "[audiouol]234234[/audiouol]"]
*/
const resultRegExp = string.match(regExp)
resultRegExp.map(item => {
.l-card {
width: 290px;
}
.card {
overflow: hidden;
border-radius: 5px;
border: 1px solid #d4d4d5;
}
.l-card {
width: 290px;
}
.card {
overflow: hidden;
border-radius: 5px;
border: 1px solid #d4d4d5;
}
.card {
width: 290px;
overflow: hidden;
border-radius: 5px;
border: 1px solid #d4d4d5;
}
.card__img {
display: block;
}
.card {
width: 290px;
overflow: hidden;
border-radius: 5px;
border: 1px solid #d4d4d5;
}
.card img {
display: block;
}
@tosipaulo
tosipaulo / menu.css
Last active October 26, 2017 14:40
Usando exemplo para BEM
.menu {} /* ul */
.menu__item {} /* li */
.menu__link {} /* a */
.menu__item--active {} /* modificar o estado do a */
import React, { Component } from 'react'
import {Link} from 'react-router-dom'
import api from './Api'
class Cakes extends Component {
constructor(props){
super(props)
}