Skip to content

Instantly share code, notes, and snippets.

View Robert-IMT's full-sized avatar

Robert Robert-IMT

View GitHub Profile
$out = phpinfo2array(); // https://www.php.net/manual/ru/function.phpinfo.php#117961
writeToLogFile( $out ); // https://gist.github.com/Robert-IMT/98d5e9f6aa86b8f922cf6196b80320a9
/**
* Write variable value to file
*
* @param mixed $data
* @param string $file
*/
function writeToLogFile( $data, $file = 'tmp/log.txt' ) {
$developers = array(
'127.0.0.1', // localhost
/** Scroll */
::-webkit-scrollbar {
background-color: transparent;
width: 6px;
}
::-webkit-scrollbar-button {
background-color: transparent;
}
::-webkit-scrollbar-track {
jQuery( '#custom-phone input' ).bind( "change keyup input click", function() {
if( this.value.match( /[^0-9]/g ) ){
this.value=this.value.replace( /[^0-9]/g, '' );
}
});
@Robert-IMT
Robert-IMT / [jQuery] Animated number counter
Last active November 8, 2021 21:52
jQuery animated number counter from Zero to value
$('.count').each(function () {
$(this).prop('Counter',0).animate({
Counter: $(this).text()
}, {
duration: 4000,
easing: 'swing',
step: function (now) {
$(this).text(Math.ceil(now));
}
});
@Robert-IMT
Robert-IMT / [css] Vertical text alignment
Last active July 11, 2016 05:10
Vertical text alignment (flex)
div {
height:100%;
width:100%;
margin:0;
display:flex;
}
div > span {
margin:auto;
font-size: 2em;
}
<span class="social">
<a target="_blank" rel="nofollow" onclick="popupWin = window.open(this.href, 'vkontakte', 'width=550,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-550)/2)+',location=no'); popupWin.focus(); return false;" href="http://vk.com/share.php?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&description=<?php echo strip_tags(get_the_excerpt()); ?>&image=<?php echo $image_url; ?>&noparse=true" title="<?php _e('Поделится в ВК', 'prestigednepr'); ?>">
<i class="fa fa-vk"></i>
</a>
<a target="_blank" rel="nofollow" onclick="popupWin = window.open(this.href, 'vkontakte', 'width=550,height=400,top='+((screen.height-400)/2)+',left='+((screen.width-550)/2)+',location=no'); popupWin.focus(); return false;" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" title="<?php _e('Поделится в Facebook', 'prestigednepr'); ?>">
<i class="fa fa-facebook"></i>
</a>
<a target="_blank" rel="nofollow" onclick="popupWin = window.open(this.href, 'vkon
<?php
$collection = $category->getProductCollection();
$collection -> addAttributeToSelect(array('NAME_OF_ATTRIBUTE1','NAME_OF_ATTRIBUTE2'));
?>
<?php
foreach ( $collection as $_product ) {
echo $_product -> getNameOfAttribute();
echo $_product -> getAttributeText('NAME_OF_ATTRIBUTE') ;
echo $_product -> getData('NAME_OF_ATTRIBUTE');
NOTE:
rename oc_ to prefix table
rename id1,id2 to ID products
===
DELETE t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15
FROM oc_product t1
LEFT JOIN oc_product_attribute t2 ON(t1.product_id=t2.product_id)
LEFT JOIN oc_product_description t3 ON(t1.product_id=t3.product_id)