Skip to content

Instantly share code, notes, and snippets.

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

Talles Airan tallesairan

🏠
Working from home
View GitHub Profile
<?php
/*
Plugin Name: woocommerce modal variationn
Plugin URI: #
Description: show modal window with product variations after clicking -add to cart-.
Version: 0.1
Author: Maks Buriy
Author URI: mailto:[email protected]
License: GPL2
*/
@tallesairan
tallesairan / SCSS.md
Created April 16, 2019 17:52 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

(function ( wpI18n, wpBlocks, wpElement, wpEditor, wpComponents ) {
const { __ } = wpI18n;
const { Component, Fragment } = wpElement;
const { registerBlockType } = wpBlocks;
const { InspectorControls, RichText, PanelColorSettings, InnerBlocks } = wpEditor;
const { RangeControl, PanelBody, BaseControl , SelectControl, ToggleControl } = wpComponents;
const HEADER_ICONS = {
plus: (
<Fragment>
@tallesairan
tallesairan / restfull-htaccess
Last active March 11, 2019 12:55 — forked from umidjons/restfull-htaccess
Allow GET,POST,PUT,DELETE RESTful requests in .htaccess
#apache 2.2 or 2.4
<Limit GET HEAD POST PUT DELETE OPTIONS>
# Deprecated apache 2.2 syntax:
# Order Allow,Deny
# Allow from all
# Apache > 2.4 requires:
Require all granted
</Limit>
@tallesairan
tallesairan / _widget.scss
Created February 25, 2019 16:48
Bootstrap Simple widget
.widget {
padding: 0;
margin: 9px 0 16px 0;
h2{
text-transform: uppercase;
color: up-colors('second');
border-bottom: 1px solid;
}
a, b, p, span, ul, li {
color: up-colors('second');
@tallesairan
tallesairan / gtag-cf7-event.js
Last active March 15, 2020 22:53
Google Tag Event - contact form 7
function sanitizeString(str){
str = str.replace(/[^a-z0-9áéíóúñü \.,_-]/gim,"");
return str.trim().toLowerCase();
}
document.addEventListener( 'wpcf7mailsent', function( event ) {
details = event.detail;
let eventParams = {};
let contatFormEventParams = event.detail.inputs;
$.each(contatFormEventParams,function(key,value){
objectName = sanitizeString(value['name']);
@tallesairan
tallesairan / kill-process-by-port.sh
Created February 8, 2019 11:01
Kill process by port
To list any process listening to the port 8080:
lsof -i:8080
To kill any process listening to the port 8080:
kill $(lsof -t -i:8080)
or more violently:
kill -9 $(lsof -t -i:8080)
(-9 corresponds to the SIGKILL - terminate immediately/hard kill
@tallesairan
tallesairan / check-is-valid-plate.js
Created February 6, 2019 18:36
check if is valid plate
$(".verifyPlate").click(function (e) {
let tt = $(this);
$('#plan').val(tt.data('plan'));
let inputs = {
plate: $('#plate').val(),
chassi: $('#chassi').val()
};
if ($('.verifyTab.active').attr('id') === 'vehicle') {
if (inputs.chassi === '' && inputs.plate === '') {
@tallesairan
tallesairan / checkdisabled-button.js
Created February 6, 2019 18:34
check if is disabled button
$(document).on('click','.finishStep',function (e) {
e.preventDefault();
if($(this).hasClass('disabled')){
console.log('disabled');
let paymentTab = $('#paymentTab');
if (checkcarro.isMobile) {
$('html,body').animate({
scrollTop: paymentTab.offset().top - 200
}, 'slow');
@tallesairan
tallesairan / delete-qtranslate-tags.sql
Created February 5, 2019 17:01
clean database after qTranslate uninstall
ALTER TABLE `yourPrefix_posts` ADD COLUMN tmp_excerpt TEXT(222) AFTER post_content;
UPDATE `yourPrefix_posts` SET tmp_excerpt =
SUBSTRING(
post_content
FROM 1
FOR LOCATE(
'<!--more-->',
post_content
) - 1
);