Skip to content

Instantly share code, notes, and snippets.

View mankutila's full-sized avatar
✌️

Maša Piaredryj mankutila

✌️
View GitHub Profile
@mankutila
mankutila / compress-images.sh
Last active October 31, 2018 15:58
Compress images with ImageMagick on Windows 10
FOR %a IN (*.png) DO convert "%a" -strip -depth 24 -define png:compression-filter=2 \ -define png:compression-level=9 -define png:compression-strategy=1 "opt\%a"
FOR %a IN (*.jpg) DO convert "%a" -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace sRGB "opt\%a"
.visually-hidden {
position: absolute;
overflow: hidden;
clip: rect(0 0 0 0);
height: 1px; width: 1px;
margin: -1px; padding: 0; border: 0;
}
@mankutila
mankutila / last_row_flex_fix.css
Created January 12, 2018 14:34
Flex space-between last row fix
.row {
display: flex;
flex-wrap: wrap;
justify-content:space-between;
}
.row:after {
content: "";
flex: auto;
flex-basis: 208px; //width of the other flex-items for right one-row display; if necessary
}
function filter_projects_by_taxonomies( $post_type, $which ) {
if ( 'project' !== $post_type ) //your post type name instead of 'project'
return;
$taxonomies = array( 'type' ); //your post type taxonomy name instead of 'type'
foreach ( $taxonomies as $taxonomy_slug ) {
$taxonomy_obj = get_taxonomy( $taxonomy_slug );
$taxonomy_name = $taxonomy_obj->labels->name;
$terms = get_terms( $taxonomy_slug );
@mankutila
mankutila / checkbox.pug
Created December 12, 2017 12:46
Custom checkbox / radio button
.checkbox-wrapper
input(type="checkbox", id="checkboxId", name="checkboxName")
label(for="checkboxId") м. Семеновская
span
@mankutila
mankutila / modal.css
Last active December 29, 2017 08:55
Right implementation of modal window
.html-modal-opened {
padding-right: calc(100vw - 100%);
}
.body-modal-opened {
overflow-y: hidden;
}
.modal {
display: none;
@mankutila
mankutila / customSelect.js
Last active December 12, 2017 12:32
Creates html `<select>` with custom styling
function initCustomSelects(selectors) {
$(selectors).each(function(){
var $this = $(this), numberOfOptions = $(this).children('option').length;
$this.addClass('select-hidden');
$this.wrap('<div class="select"></div>');
$this.after('<div class="select-styled"></div>');
var $styledSelect = $this.next('div.select-styled');
$styledSelect.text($this.children('option').eq(0).text());
@mankutila
mankutila / fadeInToFlex.js
Created November 23, 2017 13:07
Makes block fade in not to display: block but display: flex
$(block)
.css("display", "flex")
.hide()
.fadeIn();
@mankutila
mankutila / header.php
Last active January 20, 2018 14:40
Show meta information in WP using ACF
<title><?php showMeta('title');?></title>
<meta name="description" content="<?php showMeta('description');?>">
@mankutila
mankutila / viewport.html
Created November 1, 2017 12:45
Meta viewport
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">