Skip to content

Instantly share code, notes, and snippets.

View RuslanHolovko's full-sized avatar

RuslanHolovko

View GitHub Profile
@RuslanHolovko
RuslanHolovko / email-template.html
Created September 3, 2020 15:33
button center position in table
<table
align="center"
style="background: url('https://source.unsplash.com/random/300x500');
background-size:contain;
background-repeat: no-repeat;
max-width: 700px;
width: 100%;">
<tbody>
<tr align="center">
@RuslanHolovko
RuslanHolovko / fon-size-mixin.scss
Created July 30, 2020 07:27
Generating classes with sass mixin
// FONT SIZES MIXIN START
$fontSizes: (
10: 10,
12: 12,
15: 15,
18: 18,
20: 20,
25: 25
);
@mixin fz-modifiers {
@RuslanHolovko
RuslanHolovko / observer.js
Created June 4, 2020 07:55
Observer component for vue js
<!-- Observer.vue -->
<template>
<div class="observer"/>
</template>
<script>
export default {
data: () => ({
observer: null,
}),
@RuslanHolovko
RuslanHolovko / etstime.js
Created May 7, 2020 15:15
Get ETS time javascript
// Getting Eastern Time
var offset = new Date().getTimezoneOffset();
var CurrentDate = new Date();
var easternTimeOffset = -240;
CurrentDate.setMinutes ( CurrentDate.getMinutes() + offset + easternTimeOffset);
@RuslanHolovko
RuslanHolovko / debounce.js
Created April 19, 2020 15:47
debounce function
const btn = document.querySelector('.btn');
function debounce (fn, delay) {
let timeout;
return function(){
if (timeout){
clearTimeout(timeout);
}
timeout = setTimeout(()=>{
fn()
@RuslanHolovko
RuslanHolovko / comuted.js
Created April 5, 2020 12:19
computed property get set
computed:{
search: {
get() {
return this.$store.state['search'].search;
},
set(value) {
this.$store.commit("search/SETSEARCH", value);
}
}
}
var list = ['1','2','3','4','5']
function chunkArr (arr, count){
var res = [],
i = 0;
while(i < arr.length){
res.push(arr.slice(i, i+= count))
}
return res;
@RuslanHolovko
RuslanHolovko / image-gallery.php
Created February 26, 2020 13:37
open cart product image gallery
@RuslanHolovko
RuslanHolovko / camera.html
Created February 10, 2020 15:26
enabled web camera
<video id="video" autoplay controls></video>
<script>
video = document.getElementById("video");
const option = {
video: true,
audio: false
};
// Get image from camera
@RuslanHolovko
RuslanHolovko / breadcrumb.html
Created February 5, 2020 16:36
schema breadcrumbs example
<ul itemscope itemtype="http://schema.org/BreadcrumbList">
<?php $index = 1; ?>
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" itemtype="https://schema.org/Thing" itemid="<?php echo $mbreadcrumb['href']; ?>" itemscope href="<?php echo $mbreadcrumb['href']; ?>">
<span itemprop="name"><?php echo $index; ?></span>