Skip to content

Instantly share code, notes, and snippets.

View mfd's full-sized avatar

Kami mfd

  • Checkmagush
View GitHub Profile
@mfd
mfd / owl.css
Last active January 15, 2016 13:00
carousel
@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;
@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 / anim.less
Last active November 16, 2016 18:44
LESS | items delay animation mixin
.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 November 16, 2016 18:54
Get random item from JavaScript array
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 November 16, 2016 18:55
convert cyrillic to english (for id's, url's)
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 / jade-json.jade
Last active November 17, 2016 05:45
jade data two colums
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 / index.jade
Created November 17, 2016 17:16
jade extends
//- index.pug
extends layout
block modalWrap
- modalClass.push('company_user')
block modal-body