Skip to content

Instantly share code, notes, and snippets.

View felipegenuino's full-sized avatar
🇧🇷
Hello from Brazil

Felipe Genuino felipegenuino

🇧🇷
Hello from Brazil
View GitHub Profile
@felipegenuino
felipegenuino / atalhos.txt
Last active October 21, 2021 04:34
Epub tricks
<sup><a id="back_note_2" href="nota1.html#note_2" title="Nota 2">2</a></sup>
<figure id="id_figuraX">
<figcaption>vx</figcaption>
<img class="responsive-image" alt=" xxx" src="doc4-figuraX.jpg"/>
<figcaption class="figcaption-bottom">sss <sup><a id="back_note_11" href="nota11.html#note_11" title="Nota 11">11</a></sup> </figcaption>
</figure>
@felipegenuino
felipegenuino / fizzbuzz-2.js
Last active February 7, 2021 20:52
Lean JS
// Divisivel por 3 = Fiz
// Divisível por 5 = Buzz
// Divisível por 3 e 5 = FizzBuzz
// Não divisível por 3 ou 5 = entrada
// não é um Número
const number = 3;
entrada = fizzBuzz(number)
// for (let i = 0; i < number; i++) {
@felipegenuino
felipegenuino / liveSearch.js
Last active August 18, 2020 13:49
Simple Live Search with jquery with feedback
$('.globalSearchResultNoFoundFeedback').hide()
$(".globalInputSearch").keyup(function() {
// Retrieve the input field text and reset the count to zero
let filter = $(this).val(),
count = 0;
if (count == 0) {
$('.globalSearchResultNoFoundFeedback').hide()
@felipegenuino
felipegenuino / setState
Last active July 27, 2020 00:26
React Hooks
import React, { useState } from "react";
import "./styles.css";
export default function App() {
const [counter, setCounter] = useState(0);
function handlePlus() {
return setCounter(counter + 1);
}
@felipegenuino
felipegenuino / script.js
Last active July 18, 2020 05:31
popover-landpage.html
/*
carrega o código após carregamento da landpage
foi feito dessa forma, pois o popover precisa ser carregado após carregar o form do RD
*/
window.onload = function(){
const $message = '<span class="lp-popover-target" tabindex="0"> icone </span> <div class="lp-popover-content"> O projetista deve preencher os dados do formulário e enviar um link compatível (via Google Drive, Dropbox, Mega, etc) com os arquivosdo projeto no formato do software (Eberick e/ou QiBuilder) e IFC + um vídeo curto (de até 30 segundos) do modelo em realidade aumentada. </div>'
let $popover = $( "<div class='lp-popover'>" + $message+ "</div>" );
$('label[for=rd-text_field-kcossuew].bricks-form__label').append( $popover );
}
@felipegenuino
felipegenuino / content.php
Created May 26, 2020 05:05
[Frontend] WooCommerce: Ultimos produtos
<?php //wp-looping
global $product;
$product = wc_get_product();
?>
<?php if($product->get_stock_quantity() <= $product->get_low_stock_amount() ) : ?>
<span class="courses-and-events__list__card__badge">ÚLTIMAS VAGAS</span>
<?php endif; ?>
@felipegenuino
felipegenuino / Remove-all-files-in_gitignore
Created April 18, 2020 15:24
Remove all files in .gitignore
git rm -r --cached .
git add .
git commit -m "Removing all files in .gitignore"
@felipegenuino
felipegenuino / .html
Created March 27, 2020 12:57
Line Clamping (Cross-Browser, Pure CSS)
<p class="line-clamp line-clamp-2">This is a cross-browser (pure CSS) solution that will clamp text to X number of lines with a trailing ellipsis in Webkit browsers. The `height` property is used on other browsers (along with a fading text effect) as a graceful fallback in non-Webkit browsers. The use of CSS `calc` allows for any font-size to work properly; i.e. you don't need a fixed height or a fixed font size for this to work! Play with it :-) You can change the second class to `line-clamp-[1|2|3|4|5]` and experiment with this just a little.</p>
*::-webkit-scrollbar { width: 5px;}
*::-webkit-scrollbar-track {background: #F4F4F4;}
*::-webkit-scrollbar-thumb {background: #cecece;}
*::-webkit-scrollbar-thumb:hover {background: #c1c1c1;}
body{}
@felipegenuino
felipegenuino / index.js
Created March 23, 2020 15:12
Basic express
const express = require('express');
const app = express();
app.get('/', (request, response)=>{
return response.json({
evento: 'Semana Corona Virus',
aluno: 'Felipe Genuino'
})
})