Skip to content

Instantly share code, notes, and snippets.

View russo97's full-sized avatar
🏠
Working from home

Wanderson Silva russo97

🏠
Working from home
View GitHub Profile
@russo97
russo97 / React.Children.js
Created July 13, 2021 21:36
React Children exemple
{ React.Children.map(child => child.type == Item ? child : null) }
@russo97
russo97 / Home.template
Last active July 19, 2021 14:30
Variáveis de ambiente e Widgets Linx
<!-- impressão de valor no front -->
<div class="main-bar">
{{ Config.General.Store.Phone }}
</div>
@russo97
russo97 / lineLimit.css
Created July 19, 2021 18:26
Text line limit with CSS
.text {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2; /* number of lines to show */
-webkit-box-orient: vertical;
}
@russo97
russo97 / normalizeText.js
Last active May 15, 2022 02:38
Remove special characters from an argument string
function normalizeText (text) {
return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
// normalizeText('áçí') => aci
@russo97
russo97 / datepicker.html
Last active February 3, 2022 13:21
Date Picker
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/datepicker/1.0.10/datepicker.css" integrity="sha512-n/98Hzv7vnNVN8bL5s+hajql1X8LVhS/kPJIMxpXinGzcIVcM+SKTG54IKnRVz8vPIJmWWtyRyP3p4aK3vLiZw==" crossorigin="anonymous" referrerpolicy="no-referrer">
<script src="https://cdnjs.cloudflare.com/ajax/libs/datepicker/1.0.10/datepicker.min.js" integrity="sha512-RCgrAvvoLpP7KVgTkTctrUdv7C6t7Un3p1iaoPr1++3pybCyCsCZZN7QEHMZTcJTmcJ7jzexTO+eFpHk4OCFAg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datepicker/1.0.10/i18n/datepicker.pt-BR.min.js" integrity="sha512-ecglO5oibZlGXLfdIbAuHLD7QIM3DOB2eCDrMOIpcP+V05KNWHv+6DmwDkw43N3noRS/0k37wOhCS0WlGz82Ow==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript">
$('#rd-text_field-kyvprveb').datepicker({
autoclose: true,
language: 'pt-BR',
format: 'DD/MM/YYYY',
});
@russo97
russo97 / Rollpage.js
Created January 27, 2022 18:18
Roll Page
$('#rd-button-kyvzb3m6').on('click', function (e) {
e.preventDefault();
$('html, body').animate({
scrollTop: $('#rd-box-joq3m2m2').offset().top
}, 800, 'swing', function () {
$('input[name="name"]').focus();
});
});
@russo97
russo97 / hide-scrollbar.scss
Last active June 8, 2022 21:04
Hide Scrollbar
.element {
scrollbar-width: none;
&::-webkit-scrollbar {
display: none !important;
}
}
@russo97
russo97 / ListFormat.js
Created February 16, 2022 14:24
List Format using Javascript
(function () {
const formattedList = new Intl.ListFormat('pt-BR').format(["Banana", "Maça", "Laranja"]);
console.log(formattedList);
})();
@russo97
russo97 / functions.php
Last active May 20, 2022 13:48
Expose CPT data in WordPress
<?php
function exibir_pesquisas () {
$args = array(
'post_type' => 'desenvolvimento', 'posts_per_page' => -1
);
$wp_query = new WP_Query($args);
if ($wp_query->have_posts()) {
@russo97
russo97 / something.twig
Created March 14, 2022 13:51
repeater with images on Timber
{% for image in post.meta('field_name') %}
<img src="{{ image.imagem.url }}" alt="" />
{% endfor %}