Skip to content

Instantly share code, notes, and snippets.

Kami mfd

Block or report user

Report or block mfd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mfd
mfd / arr.js
Last active Aug 2, 2018
js snipp
View arr.js
elems = document.querySelectorAll('ul.projects-list span.project-name');
for (var i in elems) {
arr.push(elems[i].innerText)
}
// delete similar
var uniq = arr
.map((name) => {
return {count: 1, name: name}
})
.reduce((a, b) => {
@mfd
mfd / multifields.js
Created Oct 24, 2017
multifields for x-editable
View multifields.js
(function ($) {
"use strict";
var TwoFields = function (options) {
this.init('twofield', options, TwoFields.defaults);
};
//inherit from Abstract input
$.fn.editableutils.inherit(TwoFields, $.fn.editabletypes.abstractinput);
View Cera-OpenSans.css
/*
https://cdn.rawgit.com/mfd/d9c37ef7482ac74456b1bd022c4041ae/raw/6a757485691f8e8d0c31cd461cd48960dab5f5ad/%2520Cera-open.css
*/
@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i&subset=cyrillic-ext"
@import "https://fonts.googleapis.com/css?family=Merriweather:300,300i,400,400i,700,700i,900,900i&subset=cyrillic,cyrillic-ext"
@font-face {
font-family: 'Cera';
font-style: italic;
@mfd
mfd / jquery.hoverIntent.min.js
Last active Oct 9, 2017
sngstats__topslots scripts
View jquery.hoverIntent.min.js
/*!
* hoverIntent v1.9.0 // 2017.09.01 // jQuery v1.7.0+
* http://briancherne.github.io/jquery-hoverIntent/
*
* You may use hoverIntent under the terms of the MIT license. Basically that
* means you are free to use hoverIntent as long as this header is left intact.
* Copyright 2007-2017 Brian Cherne
*/
!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,track=function(ev){cX=ev.pageX,cY=ev.pageY},compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)},delay=function(ev,$el,s,out){return delete $el.data("hoverIntent")[s.id],out.apply($el[0],[ev])};$.
@mfd
mfd / bootstrap-mq.scss
Created Oct 5, 2017 — forked from olegpolyakov/bootstrap-mq.scss
Bootstrap Sass Media Query Variables
View bootstrap-mq.scss
//== Media queries breakpoints
// Extra small screen / phone
$screen-xs: 480px;
$screen-xs-min: $screen-xs;
// Small screen / tablet
$screen-sm: 768px;
$screen-sm-min: $screen-sm;
View fromMgn__multiline.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View _bm_strava2gpx.md

Strava2gpx

make bookmarklet

(function(){
  /**
   * Loader for bookmarklets.
   * 
   * @author Alexey V. Ptitsyn <a@skippy.su>
   * 
@mfd
mfd / osx-terminal-rename.sh
Created Oct 3, 2017
Bulk Rename in osx terminal
View osx-terminal-rename.sh
# General format:
brew install rename
# General format:
rename -v s/OLD/NEW/ FILENAMES
# Where:
# - OLD is a regular expression
# - NEW is the replacement pattern
# - FILENAMES is a list of files to search/replace
@mfd
mfd / pluralize.js
Last active Sep 23, 2017
cyrillic pluralize
View pluralize.js
var t = {
d: 6,
h: 5,
m: 23,
s: 53
}
var pluralize = function(t, e) {
var s = void 0
, n = e % 100;
@mfd
mfd / ImageMagick_snippets.md
Last active Mar 20, 2018
ImageMagick sprite image snippets
View ImageMagick_snippets.md

imagemagick sprite

convert $(ls *.png | sort -r) +append res/result-sprite-vertical.png
convert $(ls *.png) -append res/result-sprite-horizontal.png
convert *png *gif -append PNG8:res/result-sprite-horizon.png

imagemagick Montage #

montage *.png -background transparent -geometry +4+4  res/sprite.png
montage $(ls *.png -t) -mode Concatenate -tile 2x16+1+1 -border 2 res/sprite.png
You can’t perform that action at this time.