Skip to content

Instantly share code, notes, and snippets.

Avatar
🌴

Arkady Lukashov arkadylukashov

🌴
View GitHub Profile
View filter.js
import _ from 'lodash'
export const state = () => ({
_contains: 'some',
_badges: null,
_topics: [],
_dates: [],
_upvotes: 0,
})
View HeaderFilter.vue
<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 / combos.php
Created May 25, 2016 — forked from fabiocicerchia/combos.php
PHP - Generate all the possible combinations among a set of nested arrays.
View combos.php
/**
* 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)
View numberend.js
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)]];
}
View Fixed footer
@arkadylukashov
arkadylukashov / pinnize.js
Last active Dec 21, 2015
Simple plugin that transform your inline-blocked item layout into a pinterest-like grid
View pinnize.js
/**
* 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 / jquery.preload.piecon.js
Created Jan 21, 2013
Simple image preloader uses jQuery and Piecon
View jquery.preload.piecon.js
/* piecon */
(function(){var i={},j=null,k=null,f=null,g=null,h={},l={color:"#ff0084",background:"#bbb",shadow:"#fff",fallback:!1},c,o=navigator.userAgent.toLowerCase();c=function(e){return-1!==o.indexOf(e)};var p=c("msie");c("chrome");c("chrome")||c("safari");var q=c("safari")&&!c("chrome");c("mozilla")&&!c("chrome")&&c("safari");var m=function(e){for(var a=document.getElementsByTagName("link"),c=document.getElementsByTagName("head")[0],f=0,h=a.length;f<h;f++)("icon"===a[f].getAttribute("rel")||"shortcut icon"===
a[f].getAttribute("rel"))&&c.removeChild(a[f]);a=document.createElement("link");a.type="image/x-icon";a.rel="icon";a.href=e;document.getElementsByTagName("head")[0].appendChild(a)},n=function(){g||(g=document.createElement("canvas"),g.width=16,g.height=16);return g};i.setOptions=function(e){h={};for(var a in l)h[a]=e.hasOwnProperty(a)?e[a]:l[a];return this};i.setProgress=function(e){f||(f=document.title);if(!k||!j){var a;a:{a=document.getElementsByTagName("link");for(var c=0,i=a.length;c<i;c++)if("i
View RequestAnimationFrame.js
/**
* Provides requestAnimationFrame in a cross browser way.
* @author paulirish / http://paulirish.com/
*/
if ( !window.requestAnimationFrame ) {
window.requestAnimationFrame = ( function() {
return window.webkitRequestAnimationFrame ||
@arkadylukashov
arkadylukashov / jquery.preload.js
Created Dec 19, 2012
Simple image preloader uses jQuery
View jquery.preload.js
(function($) {
$.fn.preload = function(forPreload, options) {
var settings = $.extend({
debug : false,
percentage : {
textCnt : '',
lineCnt : ''
},
@arkadylukashov
arkadylukashov / jquery.fullscreen.js
Created Dec 19, 2012
Simple jQuery element based Fullscreen API wrapper
View jquery.fullscreen.js
(function($) {
$.fn.fullscreen = function(options) {
var settings = $.extend({
to: false,
exit: 'Normal size',
onScreenChange: $.noop,
onFail: $.noop
},options);
You can’t perform that action at this time.