Skip to content

Instantly share code, notes, and snippets.

View spac3unit's full-sized avatar

Denis spac3unit

View GitHub Profile
This mixin depends on Modernizr and creates a bit more work for you when creating images for your site, but it’s really worth it in the end.
You need one .svg file, that will serve as the default background image. You’ll also need a regular .png that serves as a fallback for non-svg-supporting browsers. And last you need a twice as large .png as a second fallback to retina screens.
All in all you need this:
* pattern.svg
* pattern.png
* pattern@2x.png
$image-path: '../img' !default;
$fallback-extension: 'png' !default;
$retina-suffix: '@2x';
%clearfix {
*zoom: 1;
&:before, &:after {
content: ' ';
display: table;
}
&:after {
clear: both;
//Without gutter
// width: calc(100% / total_number_of_columns * columns )
//With gutter
// width: calc((100% / total_number_of_columns * columns) - the gutter)
$columns: 12;
$gutter_width: 5%;
$total_width: 100%;
@function grid-width($cols, $has-gutter:false) {
@spac3unit
spac3unit / tmux-cheatsheet.markdown
Created December 1, 2016 14:28 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
// Usage
//HTML
<a href="#" class="menu-button" id="menuButton">
<span class="burger-icon"></span>
</a>
<script>
var menuButton = document.getElementById('menuButton');
menuButton.addEventListener('click', function (e) {
export default class PriceRangeInput extends Component {
constructor(props) {
super(props);
this.state = {
currentRange: {
min: '',
max: ''
}
}
https://habrahabr.ru/post/239863/
Хорошим примером использования является возврат ссылки на функцию. Мы можем возвращать наружу разные ссылки, которые делают возможным доступ к тому, что было определено внутри.
var sayHello = function (name) {
var text = 'Hello, ' + name;
return function () {
console.log(text);
};
};
@spac3unit
spac3unit / span-responsive-output.scss
Created December 23, 2016 03:05
span-responsiv sass mixin based on Susy
/*
SPAN-RESPONSIVE
Create responsive, mobile first gallery-like grids using Susy.
Columns have the same size, only the amount of columns in a row change.
Accepts a single argument as a list.
$example-layouts: 2 30em, 4 50em, 8 60em;
//for any elem!!
position: relative;
top: 50%;
transform: translateY(-50%);