This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .hyphenate { | |
| overflow-wrap: break-word; | |
| word-wrap: break-word; | |
| -webkit-hyphens: auto; | |
| -ms-hyphens: auto; | |
| -moz-hyphens: auto; | |
| hyphens: auto; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1- Create a bare git repo in the server | |
| git init --bare | |
| 2- Turn your local project into a git project | |
| git init | |
| 3- Set the remote destination in your local git config file | |
| [remote "origin"] | |
| url = ssh://skygo@10.64.136.58/var/www/html/skystore | |
| fetch = +refs/heads/*:refs/remotes/origin/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var loadImageOnScrollIntoView = function(img) { | |
| var imgPos = img.getBoundingClientRect(), | |
| src = img.getAttribute('data-src'); | |
| window.addEventListener('scroll', function loadImgWhenVisible() { | |
| return window.scrollY >= (imgPos.top - window.innerHeight) ? (img.src = src, window.removeEventListener('scroll', loadImgWhenVisible)) : false; | |
| }); | |
| }; | |
| Array.apply(null, document.querySelectorAll('img')).forEach(function(e) { | |
| loadImageOnScrollIntoView(e); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .clearfix { | |
| &:before, | |
| &:after { | |
| content: ""; | |
| display: table; | |
| } | |
| &:after { clear: both; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mixin cont { | |
| background-color: black; | |
| color: white; | |
| @content; | |
| } | |
| div { | |
| @include cont { | |
| font-size: 12px; | |
| font-style: italic; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @mixin pad ($pads...) { | |
| padding: $pads; | |
| } | |
| .one { | |
| @include pad(20px); | |
| } | |
| .two { | |
| @include pad(10px 20px); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $base-color: orange; | |
| @mixin headline($size, $color: $base-color) { | |
| color: $color; | |
| font-size: $size; | |
| } | |
| h1 { | |
| @include headline(12px); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1 - BOX SIZING | |
| @mixin box-sizing($type) | |
| { | |
| -webkit-box-sizing:$type; | |
| -moz-box-sizing:$type; | |
| box-sizing:$type; | |
| } | |
| div { | |
| @include box-sizing(border-box); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // abuse | |
| var orig = [...]; | |
| var stuff = []; | |
| _.each(orig, function (item) { | |
| var t = // do something to item | |
| // Mutate somebody else's thing | |
| stuff.push(t); | |
| }; | |
| // reduce |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var obj = { | |
| foo: 'foo', | |
| toJSON: function () { | |
| return 'bar'; | |
| } | |
| }; | |
| JSON.stringify(obj); // '"bar"' | |
| JSON.stringify({x: obj}); // '{"x":"bar"}' |