Skip to content

Instantly share code, notes, and snippets.

@wujekbogdan
wujekbogdan / gist:67cdd643d32cca4ec860
Last active August 29, 2015 14:06
Remove default WordPress Dashboard widgets (WordPress 4.0)
function mytheme_remove_dashboard_widgets()
{
$widgets = array(
'dashboard_incoming_links' => 'normal',
'dashboard_right_now' => 'normal',
'dashboard_plugins' => 'normal',
'dashboard_recent_comments' => 'normal',
'dashboard_activity' => 'normal',
'dashboard_quick_press' => 'side',
'dashboard_primary' => 'side',
@wujekbogdan
wujekbogdan / Gridlover LESS Mixins
Last active August 29, 2015 14:07
Gridlover LESS Mixins
// Mixins
.h1() {
font-size: @h1-font-size;
line-height: @h1-line-height;
margin-top: @h1-margin-top;
margin-bottom: @h1-margin-bottom;
}
.h2() {
font-size: @h2-font-size;
@wujekbogdan
wujekbogdan / Breakpoints matcher
Created October 23, 2014 13:37
Breakpoints matcher
breakpoints = {
sizes: {
'xs': 480,
'sm': 768,
'md': 992,
'lg': 1200
},
upTo: function( to ) {
var _to = this.sizes[to];
return 'only screen and (max-width:' + _to + 'px)';
@wujekbogdan
wujekbogdan / cpt.php
Last active September 16, 2015 16:41
Wordpress: disables singulars for custom post types
/**
* Disables singular post view for custom post types. Throws 404 error instead.
* @param $query
*/
function my_prefix_disable_singulars()
{
global $wp_query;
$disabled_singulars = array('post-type-1', 'post-type-2', 'post-type-3');
@wujekbogdan
wujekbogdan / bem_modifiers.md
Last active November 12, 2015 07:17
SASS BEM modifiers

Solution 1:

.block {

  &__element-1 {}

  &__element-2 {}

  &--modifier-1 &__element-1 {}
@wujekbogdan
wujekbogdan / measurements.js
Created November 12, 2019 19:27
measurements.js
import map from 'lodash/map';
import { MEASUREMENTS_SYMBOLS } from '@/helpers/nutrientSymbols';
import {
MASS_UNIT_KILOGRAM,
MASS_UNIT_POUND,
PERCENTAGE,
LENGTH_UNIT_CENTIMETER,
LENGTH_UNIT_INCH,
QUANTITY_UNIT_MG_DL,