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
View sourcemap-extract.rb
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")
@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;
@mfd
mfd / README.md
Created Jun 1, 2017 — forked from lopezjurip/README.md
OSX Homebrew: docker-machine setup
View README.md

Prerequisites

Make sure you have installed Homebrew and (Homebrew-Cask)[http://caskroom.io/].

# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install Homebrew-cask
brew install caskroom/cask/brew-cask
@mfd
mfd / _decimal.scss
Created Feb 20, 2017 — forked from terkel/_decimal.scss
Rounding decimals in Sass
View _decimal.scss
// _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
@mfd
mfd / _sanfrancisco-font.md
Last active Jul 13, 2019 — forked from AndrewBarba/sanfrancisco-font.css
San Francisco Web Font
View _sanfrancisco-font.md

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 / gh-pages-deploy.md
Created Dec 5, 2016 — 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).
View gh-pages-deploy.md

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 / Less BEM-styled selectors
Created Nov 21, 2016 — forked from orlovmax/Less BEM-styled selectors
Less/Scss trick to generate BEM-styled selectors
View Less 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 / jade-blocks.jade
Created Nov 21, 2016 — forked from orlovmax/jade-blocks.jade
Enhanced Jade templates - BEM blocks + pass some data
View jade-blocks.jade
//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 / mixins.jade
Created Sep 6, 2016 — forked from shaneriley/mixins.jade
Jade mixins example
View mixins.jade
// Writing JS for everything is great and all, but I don't want to see JS
// inline in my Jade templates. Thankfully, there are ways of abstrating it
// into mixins!
// Want some Rails-like helpers?
mixin link_to(name, href)
- href = href || "#"
a(href="#{href}")= name
// How about a single editing point for a class name?
@mfd
mfd / modal.js
Created Jul 28, 2016 — forked from navdeepsingh/modal.js
Load Dynamic (AJAX) modal in Bootstrap 3, remove from DOM after timeout
View modal.js
$('[data-toggle="modal"]').click(function () {
var url = $(this).attr('href');
$.get(url, function (data) {
var modal = $('<div id="clue-modal" class="modal fade" tabindex="-1" role="dialog"><div class="modal-dialog"><div class="modal-content">' + data + '</div></div></div>').modal();
modal.on("hidden.bs.modal", function () {
$(this).remove();
});
setTimeout(function(){
modal.modal('hide');
},5000);
You can’t perform that action at this time.