Skip to content

Instantly share code, notes, and snippets.

View space11's full-sized avatar
🐧

Borys space11

🐧
View GitHub Profile
@space11
space11 / get-woocommerce-categories.php
Created February 22, 2018 21:27 — forked from rajeebbanstola/get-woocommerce-categories.php
Simple way to fetch WooCommerce Categories with Image and Description
<?php
$get_featured_cats = array(
'taxonomy' => 'product_cat',
'orderby' => 'name',
'hide_empty' => '0',
'include' => $cat_array
);
$all_categories = get_categories( $get_featured_cats );
$j = 1;
@space11
space11 / _grid.scss
Created May 9, 2018 20:39
The Grid System
// VERIABLES
$grid-width: 114rem;
$gutter-vertical: 8rem;
$gutter-horizontal: 6rem;
// MIXIN
@mixin clearfix {
&:after {
content: "";
display: table;
@space11
space11 / text_button.scss
Last active May 11, 2018 12:21
Text Button
// COLORS
$color-primary: #55c57a;
$color-primary-light: #7ed56f;
$color-primary-dark: #28b485;
$color-gray-light: #f7f7f7;
$color-gray-dark: #777;
$color-white: #fff;
$color-black: #000;
@space11
space11 / git-change-commit-messages.md
Last active May 11, 2018 13:21
How to change your commit messages in Git?

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@space11
space11 / gradient-text.css
Created May 11, 2018 19:59
Gradient Text
.class {
background-image: linear-gradient(
to right,
#fff,
#111
);
-webkit-background-clip: text;
color: transparent;
}
@space11
space11 / _card.scss
Created September 18, 2018 22:11
Card partial. Material Design look
@mixin box-s {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2),
0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
/* .card_______________
/* | &__body |
/* | &__header |
* | &__img--top |
@space11
space11 / smoothScroll.js
Created October 14, 2018 13:03
Vanilla JS c smooth scroll
/*
For some time, you DON'T need jQuery to make simple but beauty smooth scroll on your website.
I realize that there are several ideas of this code on the Internet,
but I have a need to resurface everything that is most important in one file.
*/
@space11
space11 / git-undo-comit.md
Created November 15, 2018 11:50
Git - undo commit

How can I undo the last commit? Note the --soft flag: this makes sure that the changes in undone revisions are preserved. After running the command, you'll find the changes as uncommitted local modifications in your working copy. $ git reset --soft HEAD~1

If you don't want to keep these changes, simply use the --hard flag. Be sure to only do this when you're sure you don't need these changes anymore. $ git reset --hard HEAD~1

@space11
space11 / uploadFileSaga.js
Created June 16, 2019 14:30 — forked from jpgorman/uploadFileSaga.js
Example of using redux-saga eventChannel with axios/fetch etc
import {eventChannel, END} from 'redux-saga'
function createUploaderChannel(key, files){
return eventChannel(emit => {
const onProgress = ({total, loaded}) => {
const percentage = Math.round((loaded * 100) / total)
emit(percentage)
}
@space11
space11 / lockScreen.sh
Last active October 27, 2020 14:36
Ubuntu lock the screen after given time.
gsettings set org.gnome.desktop.session idle-delay $((15*60)) && \
gsettings set org.gnome.desktop.screensaver lock-delay 0 && \
gsettings set org.gnome.desktop.screensaver lock-enabled true