Skip to content

Instantly share code, notes, and snippets.

View whizark's full-sized avatar
🏞️
Working from home

Whizark whizark

🏞️
Working from home
View GitHub Profile
@whizark
whizark / SassMeister-input-HTML.html
Last active August 29, 2015 14:06
Sass: Passing/Getting property value(s) into/inside mixins/functions #sass
<a class="button">An example link</a>
<a class="button--ghost">An example link</a>
@whizark
whizark / SassMeister-input.scss
Last active August 29, 2015 14:06
Sass: Typed value factory & validator using Map #sass
// ----
// Sass (v3.4.1)
// Compass (v1.0.1)
// ----
// Sass: Typed value factory & validator using Map
// Direction type that accepts only top, right, left, bottom
// Direction type factory
@function dir-new($dir) {
@whizark
whizark / SassMeister-input.scss
Last active January 30, 2019 11:56
Sass: Generating decoupled color schemes #sass
// ----
// Sass (v3.4.1)
// Compass (v1.0.1)
// ----
// Sass: Generating decoupled color schemes
// Helper functions
@function tint($color, $percentage) {
@return mix(white, $color, $percentage);
@whizark
whizark / SassMeister-input-HTML.html
Created August 31, 2014 07:38
Sass: Polymorphic placeholder & mixins #sass
<a class="button" href="#">&lt;a&gt; button</a>
<button class="button">&lt;button&gt; button</button>
@whizark
whizark / SassMeister-input-HTML.html
Last active August 29, 2015 14:05
Sass & BEM: A flexible component definition #sass
<div class="collection">
<div class="collection__item">Item 1</div>
<div class="collection__item">Item 2</div>
<div class="collection__item">Item 3</div>
</div>
<ul class="collection">
<li class="collection__item">Item 1</li>
<li class="collection__item">Item 2</li>
<li class="collection__item">Item 3</li>
@whizark
whizark / SassMeister-input.scss
Last active August 29, 2015 14:05
Sass: Map getter & overridding #sass
// ----
// Sass (v3.4.1)
// Compass (v1.0.1)
// ----
// A property map
$properties: (
prop-1: "raw-prop-1-value",
prop-2: "raw-prop-2-value"
);
@whizark
whizark / sass-naming-convention.md
Last active April 25, 2023 13:55
Sass Naming Convention #sass #draft
@whizark
whizark / wp-best-practice.md
Last active January 3, 2016 21:31
WordPress: (My) Best Practices #draft #wordpress

WordPress: Best Practices

This is my best practices for WordPress but it is also the one FOR MOST OF THE WORDPRESSS DESIGNERS/DEVELOPERS. Some of these practices are useful to check code quality of themes/plugins.

Follow PSR

You may/should break away from WordPress Coding Standards and follow PSR if you are not a core/core-plugin developer (If you haven't followed either of WordPress Conding Standards or PSR, it is a bad habit) .

Why

@whizark
whizark / wp-service-provider.php
Last active August 29, 2015 14:04
Register WordPress $GLOBALS as services with a container (The simplest way) #test #wordpress
<?php
// This is just an example FOR WORDPRESS USERS.
//
// To make this better:
// * use namespace/class/closure etc.
// * use autoloader
// * create & use service provider classes
// * create & use factory for WP_Query, WP_User etc.
// interface ContainerInterface
@whizark
whizark / dci.php
Last active August 29, 2015 14:04
DCI in PHP #test #php
<?php
interface AccountInterface
{
public function getBalance();
public function increase($money);
public function decrease($money);
}
trait AccountTrait
{