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 / owl.css
Last active Jan 15, 2016
carousel
View owl.css
@import url('http://fonts.googleapis.com/css?family=PT+Mono&subset=all');
@import url('http://fonts.googleapis.com/css?family=PT+Serif:400,700,400italic,700italic&subset=all');
@import url('http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic&subset=all');
.wrap {
width:460px;
margin:0 auto;
}
.owl-carousel .item {
height: 380px;
View gist:3fd6ce00a668f48f9338a667eb200bd7
#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 Jul 16, 2016 — forked from kevin-smets/landscapeLock.coffee
mobile webkit landscape locking hack
View landscapeLock.coffee
$(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 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);
@mfd
mfd / jade-json.jade
Last active Nov 17, 2016
jade data two colums
View jade-json.jade
mixin listSupplInvit(obj)
ul.list.send-invit
each item in obj
li.tile
.checkbox.checkbox-styled.tile-text
label
input(type='checkbox')
span=item['name']
small=item['work']
.tile-icon
@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 / anim.less
Last active Nov 16, 2016
LESS | items delay animation mixin
View anim.less
.each-anim(@tag, @animationDuration: 1s, @animationDelay: 0.1s ) {
.@{tag} {
opacity: 0;
.rotateX(-90deg); //transform: rotateX(-90deg);
.transition(all 0.5s ease-out); //anim
}
// after load -> $('body').addClass('loaded');
body.loaded & .@{tag} {
opacity: 1;
transform: none;
@mfd
mfd / rnd.js
Last active Nov 16, 2016
Get random item from JavaScript array
View rnd.js
var items = ["a","e","i","o","u"];
var objResults = {}
for(var i = 0; i < 1000000; i++){
var randomElement = items[Math.floor(Math.random()*items.length)];
if (objResults[randomElement]){
objResults[randomElement]++
}
else {
objResults[randomElement] = 1
}
@mfd
mfd / cyr2eng.jade
Last active Nov 16, 2016
convert cyrillic to english (for id's, url's)
View cyr2eng.jade
block content
- function capit(s) {
- return s.charAt(0).toUpperCase() + s.slice(1);
- };
- function cy2en(word){
- var a = {" ":"_", "Ё":"YO","Й":"I","Ц":"TS","У":"U","К":"K","Е":"E","Н":"N","Г":"G","Ш":"SH","Щ":"SCH","З":"Z","Х":"H","Ъ":"'","ё":"yo","й":"i","ц":"ts","у":"u","к":"k","е":"e","н":"n","г":"g","ш":"sh","щ":"sch","з":"z","х":"h","ъ":"'","Ф":"F","Ы":"I","В":"V","А":"a","П":"P","Р":"R","О":"O","Л":"L","Д":"D","Ж":"ZH","Э":"E","ф":"f","ы":"i","в":"v","а":"a","п":"p","р":"r","о":"o","л":"l","д":"d","ж":"zh","э":"e","Я":"Ya","Ч":"CH","С":"S","М":"M","И":"I","Т":"T","Ь":"'","Б":"B","Ю":"YU","я":"ya","ч":"ch","с":"s","м":"m","и":"i","т":"t","ь":"y","б":"b","ю":"yu"};
- return word.split('').map(function (char) {
- return a[char] || char;
- }).join("");
- }
@mfd
mfd / index.jade
Created Nov 17, 2016
jade extends
View index.jade
//- index.pug
extends layout
block modalWrap
- modalClass.push('company_user')
block modal-body
You can’t perform that action at this time.