Skip to content

Instantly share code, notes, and snippets.

View mfd's full-sized avatar

Kami mfd

  • Checkmagush
View GitHub Profile
@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 / 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 / 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 / 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 / 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