Skip to content

Instantly share code, notes, and snippets.

View mfd's full-sized avatar

Kami mfd

  • Checkmagush
View GitHub Profile
@mfd
mfd / gist:3fd6ce00a668f48f9338a667eb200bd7
Created July 7, 2016 09:51 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@mfd
mfd / landscapeLock.coffee
Created July 16, 2016 10:23 — forked from kevin-smets/landscapeLock.coffee
mobile webkit landscape locking hack
$(window).bind("orientationchange", ->
$scope.orientation = window.orientation
$(document.body).css({
width: $(window).width()
height: $(window).height()
})
if window.orientation % 180 is 0
rotation = "rotate(-90deg)"
if window.orientation > 0
@mfd
mfd / modal.js
Created July 28, 2016 12:51 — forked from navdeepsingh/modal.js
Load Dynamic (AJAX) modal in Bootstrap 3, remove from DOM after timeout
$('[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);
@mfd
mfd / mixins.jade
Created September 6, 2016 08:50 — forked from shaneriley/mixins.jade
Jade mixins example
// 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 / 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 / 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 / README.md
Created June 1, 2017 07:50 — forked from lopezjurip/README.md
OSX Homebrew: docker-machine setup

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 / bootstrap-mq.scss
Created October 5, 2017 10:31 — forked from olegpolyakov/bootstrap-mq.scss
Bootstrap Sass Media Query Variables
//== 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;
#!/usr/bin/env ruby
require 'open-uri'
require 'pathname'
require 'json'
def strip_hash(f)
ext = f.extname
if ext.include?("?")