Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Designer in development

Rizqi Nizamil Putra rizqinizamil

🔥
Designer in development
View GitHub Profile
@rizqinizamil
rizqinizamil / wc-block-product.php
Last active Jun 17, 2020
Use content-product.php template for Woocommerce product block
View wc-block-product.php
// 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 Feb 5, 2020
Component for SVG icon
View SVGicon.js
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 Jan 27, 2020
[jQuery] Add/remove class on hover
View add-remove-hover.js
// Source: https://css-tricks.com/snippets/jquery/addingremoving-class-on-hover/
$('#elm').hover(
function(){ $(this).addClass('hover') },
function(){ $(this).removeClass('hover') }
)
View SassMeister-input.scss
// ----
// libsass (v3.2.5)
// ----
@import 'susy';
$susy: (
columns: 12,
column-width: 5em,
);
You can’t perform that action at this time.