Skip to content

Instantly share code, notes, and snippets.

View luisfelipe-dev's full-sized avatar
:octocat:
👨🏻‍💻

Luís Felipe de Olivera luisfelipe-dev

:octocat:
👨🏻‍💻
View GitHub Profile
@luisfelipe-dev
luisfelipe-dev / gist:fc17c9d924642cbee794e2dc51ff4e05
Created December 6, 2024 20:31
Show infos products Shopify
{% assign product_json = product | json %}
<pre>{{ product_json }}</pre>
import { useEffect, useState } from 'react';
export type useCountdownProps = {
targetDate: any;
countDown: any;
}
const useCountdown = (targetDate: any) => {
const countDownDate = new Date(targetDate).getTime();
@luisfelipe-dev
luisfelipe-dev / gist:40d59879ec32c52773e727f69b475946
Created February 9, 2023 20:18
intl.numberformat pt-br currency
console.log(new Intl.NumberFormat('pt-BR', { style: 'currency', currency: 'BRL' }).format(money));
@luisfelipe-dev
luisfelipe-dev / Next.js - Router Push with params
Created September 14, 2022 15:09
How to hide query params from the URL while using router.push
onClick={() =>
Router.push(
{
pathname: 'url',
query: {
status: 'status-query'
}
},
'url'
)
@luisfelipe-dev
luisfelipe-dev / index.html
Last active July 5, 2022 19:50
TABLE RESPONSIVE SCSS
<table className="rwd-table">
<tr>
<th>Movie Title</th>
<th>Genre</th>
<th>Year</th>
<th>Gross</th>
</tr>
<tr>
<td data-th="Movie Title">Star Wars</td>
<td data-th="Genre">Adventure, Sci-fi</td>
.rwd-table {
margin: 1em 0;
width: 100%;
background: #34495e;
color: #fff;
border-radius: 0.4em;
overflow: hidden;
tr {
border-top: 1px solid #ddd;
.logo_text {
position: absolute;
left: -99px;
top: -99px;
text-indent: -9999px;
}
const user = {
name: "Luís Felipe"
age: "28",
ocupation: "Front-end"
}
const userArray = Object.values(user)
console.log(userArray)
const headerElement = useRef(null);
useEffect(() => {
window.onscroll = () => {
const headerScrollPosition = headerElement.current.scrollTop + headerElement.current.clientHeight;
if (window.scrollY >= headerScrollPosition) {
setScrolled(true);
} else {
setScrolled(false);
sass --watch style.scss:styles/style.min.css --style compressed