Skip to content

Instantly share code, notes, and snippets.

View rizqinizamil's full-sized avatar
🔥
Designer in development

Rizqi Nizamil Putra rizqinizamil

🔥
Designer in development
View GitHub Profile
@rizqinizamil
rizqinizamil / wc-block-product.php
Last active June 17, 2020 09:35
Use content-product.php template for Woocommerce product block
// Source: https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/891#issuecomment-568752116
// =========================================
function _wc_get_template_part_str($template_name, $part_name=null) {
ob_start();
wc_get_template_part($template_name, $part_name);
$var = ob_get_contents();
ob_end_clean();
return $var;
}
@rizqinizamil
rizqinizamil / SVGicon.js
Created February 5, 2020 03:12
Component for SVG icon
import React from "react";
const getPath = (name, props) => {
switch (name) {
case "user":
return (
<path
{...props}
d="M12 2C9.243 2 7 4.243 7 7s2.243 5 5 5 5-2.243 5-5S14.757 2 12 2zM12 10c-1.654 0-3-1.346-3-3s1.346-3 3-3 3 1.346 3 3S13.654 10 12 10zM21 21v-1c0-3.859-3.141-7-7-7h-4c-3.86 0-7 3.141-7 7v1h2v-1c0-2.757 2.243-5 5-5h4c2.757 0 5 2.243 5 5v1H21z"
/>
@rizqinizamil
rizqinizamil / add-remove-hover.js
Created January 27, 2020 05:16
[jQuery] Add/remove class on hover
// Source: https://css-tricks.com/snippets/jquery/addingremoving-class-on-hover/
$('#elm').hover(
function(){ $(this).addClass('hover') },
function(){ $(this).removeClass('hover') }
)
// ----
// libsass (v3.2.5)
// ----
@import 'susy';
$susy: (
columns: 12,
column-width: 5em,
);