Skip to content

Instantly share code, notes, and snippets.

View mfd's full-sized avatar

Kami mfd

  • Checkmagush
View GitHub Profile
@mfd
mfd / index.jade
Last active November 21, 2016 09:19
jade menu
//- index.pug
extends layout
append sharedVars
- var pageUrl = 'about.html';
block title
| My title
block content
h1 Мой заголовок
.content
p Hello World
@mfd
mfd / jade-blocks.jade
Created November 21, 2016 12:40 — forked from orlovmax/jade-blocks.jade
Enhanced Jade templates - BEM blocks + pass some data
//LIVE EXAMPLE: http://codepen.io/orlovmax/pen/PZRXaN?editors=1000
// Define navigation mixin
mixin nav(args)
- items = args.items || {}
- active = args.active || {}
- nav = args.nav || {}
- list = args.list || {}
- item = args.item || {}
- item_active = args.item_active || {}
@mfd
mfd / Less BEM-styled selectors
Created November 21, 2016 12:48 — forked from orlovmax/Less BEM-styled selectors
Less/Scss trick to generate BEM-styled selectors
Less css trick to generate BEM-styled selectors, by Max Shirsin, http://noteskeeper.ru/1139 + Scss version
@block: ~".dm-import-feed";
@{block} {
&_step_2 {
@{block}__page_step_2 {
display: block;
}
}
@mfd
mfd / aui_del.js
Created December 2, 2016 09:55
aui delegate
A.one('.link').delegate('click',function(event) {
event.preventDefault();
console.log('hahaha');
},
'a'
);
@mfd
mfd / gh-pages-deploy.md
Created December 5, 2016 15:30 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@mfd
mfd / anim.scss
Last active March 9, 2017 08:18
items animation mixin
// Add body.loaded after page loaded
// window.onload = function() { document.body.classList.add('.loaded'); };
// $(function() { $('body').addClass('loaded'); });
// or
// Add .loaded for viewport area on page
//@include anim('.logo h1', 'translateY(20px)', 540ms );
@mixin anim($class, $transform, $animDelay:0.1s, $start: '.loaded', $transition: 'all 320ms ease-out' ) {
#{$class} {
@mfd
mfd / avenir.md
Last active April 24, 2017 14:28
Avenir Next webfont
https://cdn.rawgit.com/mfd/6940194d19c423c59b3964701c854e44/raw/4f574505e53addf632209ee262d13c700b762bae/avenir.css

<link rel="stylesheet" href="https://cdn.rawgit.com/mfd/6940194d19c423c59b3964701c854e44/raw/4f574505e53addf632209ee262d13c700b762bae/avenir.css">

@mfd
mfd / rtmp.md
Last active February 14, 2021 05:53
Grab RTMP stream from echo.msk.ru

Save RTMP video/audio stream

brew install rtmpdump

RTMPDump manual

RTMPDump

RTMPDump при скачивании потоков по умолчанию использует так называемый "Pause/Unpause BUFX hack" для увеличения скорости скачивания, но на live трансляциях и некоторых видеозаписях это приводит к тому, что выходной файл получается "дерганным", т.е. одни и те же фрагменты потока скачиваются многократно (буря мглою небо кроет... мглою небо кроет вихри снежные... небо кроет вихри... и т.д.) и размер файла становится в несколько раз больше.

@mfd
mfd / _sanfrancisco-font.md
Last active May 4, 2024 22:33
San Francisco Web Font

Web fonts

Custom webfonts

https://gist.githubusercontent.com/mfd/614e2e80a22b878bde63cb471cbe677e/raw/4996edf5eb9aea434e0cbdc81923fb110a29d060/sanfrancisco-font.css

<link rel="stylesheet prefetch" href="https://gist.githubusercontent.com/mfd/614e2e80a22b878bde63cb471cbe677e/raw/eef2aabfd0d588d43285431186a0cf70305ceb80/sanfrancisco-font.css">

@mfd
mfd / _decimal.scss
Created February 20, 2017 16:04 — forked from terkel/_decimal.scss
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0