Skip to content

Instantly share code, notes, and snippets.

View imkremen's full-sized avatar

Volodymyr Hrebnov imkremen

View GitHub Profile
@imkremen
imkremen / bezier.js
Created March 29, 2018 15:04 — forked from mckamey/bezier.js
JavaScript port of Webkit CSS cubic-bezier(p1x.p1y,p2x,p2y) and various approximations
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
@imkremen
imkremen / flexbox.less
Last active February 3, 2017 16:32 — forked from armornick/flexbox.less
Less Flexbox mixins (translation from sass)
// mixins based on code from:
// https://github.com/mastastealth/sass-flex-mixin/blob/master/_flexbox.scss
.flexbox() {
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
}
.flex-direction(@value) {
@imkremen
imkremen / ie11_flex_min-height.css
Last active December 14, 2016 17:05
IE flex min-height
.container{
background: blue;
display: flex;
align-items: center;
color: white;
}
.container:before {
content: '';
display: inline-block;
height: 100px;
//Mixin
.r-font-size(@var-from; @var-to; @size-from; @size-to; @step: 15px) {
@k: (@var-to - @var-from) / (@size-to - @size-from);
@counter: (@size-to - @size-from) / @step + 1;
.loop(@counter) when (@counter > 0) {
.loop(@counter - 1);
@width: ((@step * @counter) + @size-from - @step);
@media screen and (min-device-width: @width) {
(function($){
"use strict";
var startY;
var defaults = {
"$these": [],
"touchstartInit": false,
"touchmoveInit": false
};
.sum(@l, @i: 1, @m: 0) when (@i =< length(@l)) {
.sum(@l, @i + 1, @m + extract(@l, @i));
}
.sum(@l, @i, @m) when (@i > length(@l)) {
@sum: @m;
}
<!DOCTYPE html>
<html>
<head>
<script src="http://jashkenas.github.io/underscore/underscore-min.js"></script>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
body {
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
<title>JS Bin</title>
<style id="jsbin-css">
html {
margin: 0;