Skip to content

Instantly share code, notes, and snippets.

@StipJey
StipJey / easing.js
Created June 13, 2018 11:38 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: function (t) { return t },
// accelerating from zero velocity
easeInQuad: function (t) { return t*t },
// decelerating to zero velocity
@StipJey
StipJey / Auth.js
Last active May 16, 2017 15:10 — forked from minya92/Auth.js
/**
* Created by lapsh on 16.05.2017.
*/
import React, { Component } from 'react';
import { FormGroup, ControlLabel, FormControl, HelpBlock, Button} from 'react-bootstrap';
function FieldGroup({ id, label, help, ...props }) {
return (
<FormGroup controlId={id}>
<ControlLabel>{label}</ControlLabel>
@StipJey
StipJey / sobesed.md
Last active December 27, 2016 15:50
  1. Есть ли разница между вызовами i++ и ++i? ===
  • Разница в значении, которое возвращает такой вызов.
  • Разница в значении i после вызова.
  • Нет никакой разницы.
  1. Что делает оператор ===? ===
  • Сравнивает по ссылке, а не по значению.
  • Сравнивает без приведения типа.
@StipJey
StipJey / timeFormat
Created June 21, 2016 10:03
Переводит миллисекунды в читабельный временной формат типа чч:мм:сс
var timeFormat = (function (){
function num(val){
val = Math.floor(val);
return val < 10 ? '0' + val : val;
}
return function (ms/**number*/){
var sec = ms / 1000
, hours = sec / 3600 % 24
, minutes = sec / 60 % 60