Skip to content

Instantly share code, notes, and snippets.

@arkadylukashov
arkadylukashov / pinnize.js
Last active December 21, 2015 00:09
Simple plugin that transform your inline-blocked item layout into a pinterest-like grid
/**
* Plugin that transform ur inline-blocked grid into a
* pinterest-like grid :)
* @author arkadylukashov
* @link https://gist.github.com/arkadylukashov/6218172
*/
;(function ($) {
$.fn.pinnize = function(options) {
@arkadylukashov
arkadylukashov / Fixed footer
Last active August 29, 2015 14:14
Fixed footer
@arkadylukashov
arkadylukashov / numberend.js
Last active April 20, 2018 10:09
Number ending
function numberEnd(n, titles) {
var cases = [2, 0, 1, 1, 1, 2];
return titles[(n % 100 > 4 && n % 100 < 20) ? 2 : cases[Math.min(n % 10, 5)]];
}
@arkadylukashov
arkadylukashov / combos.php
Created May 25, 2016 18:47 — forked from fabiocicerchia/combos.php
PHP - Generate all the possible combinations among a set of nested arrays.
/**
* Generate all the possible combinations among a set of nested arrays.
*
* @param array $data The entrypoint array container.
* @param array $all The final container (used internally).
* @param array $group The sub container (used internally).
* @param mixed $val The value to append (used internally).
* @param int $i The key index (used internally).
*/
function generate_combinations(array $data, array &$all = array(), array $group = array(), $value = null, $i = 0)
<template>
<div class="filter" @click="toggleFilter" :class="{'is-active': isShowFilter}">
<div class="filter__title" :class="{'has-filter': hasFilter}">
<IconFilter class="filter__icon" />
<span class="filter__text">Filter <span>by</span></span>
</div>
<ul class="filter__list">
<li class="filter__item"
v-for="(filter, i) in list"
:key="`filter.${i}`"
@arkadylukashov
arkadylukashov / filter.js
Created August 5, 2019 12:36
Vuex filter module
import _ from 'lodash'
export const state = () => ({
_contains: 'some',
_badges: null,
_topics: [],
_dates: [],
_upvotes: 0,
})