Skip to content

Instantly share code, notes, and snippets.

View vitalyrotari's full-sized avatar
🦥
I may be slow to respond.

Vitaly Rotari vitalyrotari

🦥
I may be slow to respond.
  • Everywhere
  • Chisiau, Moldova Republic of
  • 21:00 (UTC +03:00)
View GitHub Profile
@vitalyrotari
vitalyrotari / words.js
Created July 25, 2013 14:12
AngularJS Words Filter
angular.module('app').filter("words", function() {
return function(input, words) {
if (isNaN(words)) return input;
if (words<=0) return '';
if(input) {
var inputWords = input.split(/\s+/);
if (inputWords.length > words) {
input = inputWords.slice(0, words).join(' ') + '...';
}
}
@vitalyrotari
vitalyrotari / characters.js
Created July 25, 2013 14:11
Angular Characters Filters
angular.module('app').filter('characters', function () {
return function(input, chars) {
if (isNaN(chars)) return input;
if (chars <= 0) return '';
if(input && input.length >= chars) {
input = input.substring(0, chars);
var lastspace = input.lastIndexOf(' ');
//get last space
if (lastspace !== -1) {
input = input.substr(0, lastspace);
@vitalyrotari
vitalyrotari / notify.css
Last active December 19, 2015 04:58
JavaScript Notify Plugin
/**
* Reset
*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@vitalyrotari
vitalyrotari / fx.js
Last active February 22, 2021 19:06
Vanilla JS - Fx | CSS Transition animation
(function (window, Element, undefined) {
'use strict';
var prefix = '',
eventPrefix,
vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' },
document = window.document,
testEl = document.createElement('div'),
supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,
transform,
@vitalyrotari
vitalyrotari / gestures.js
Last active April 21, 2023 16:35
Vanilla JS Touch Gestures | Original Size: 6.71KB (2.08KB gzipped) | Compiled Size: 2.69KB (1.2KB gzipped)
/*
* Vanilla JS - Touch Gestures
* @version 0.1
* @inspired QuoJS - http://quojs.tapquo.com
*
* Supported Gestures: singleTap, doubleTap, hold,
* swipe, swiping, swipeLeft, swipeRight, swipeUp, swipeDown,
* rotate, rotating, rotateLeft, rotateRight, pinch, pinching,
* pinchIn, pinchOut,
* drag, dragLeft, dragRight, dragUp, dragDown
@vitalyrotari
vitalyrotari / fx.js
Created November 9, 2012 12:40
jQuery FX Effects - Ported from ZeptoJS
// Zepto.js
// (c) 2010-2012 Thomas Fuchs
// Zepto.js may be freely distributed under the MIT license.
(function ($, undefined) {
var prefix = '', eventPrefix, endEventName, endAnimationName,
vendors = { Webkit: 'webkit', Moz: '', O: 'o', ms: 'MS' },
document = window.document, testEl = document.createElement('div'), docElem = document.documentElement,
supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,
transform,
transitionProperty, transitionDuration, transitionTiming,
@vitalyrotari
vitalyrotari / nexus7.css
Created November 9, 2012 12:30
Nexus 7 - CSS Media Query
@media only screen and (min-device-width: 800px) and (orientation: portrait) {
#device:after {
content: "Nexus 7 - portrait - firefox";
}
}
@media screen and (min-device-width : 602px) and (orientation: portrait) {
#device:after {
content: "Nexus 7 - portrait - chrome";
}
}
@vitalyrotari
vitalyrotari / touch.js
Last active July 15, 2025 10:39
jQuery Touch Gestures
jQuery Touch Gestures ported from QUOjs
@see http://quojs.tapquo.com/
Version 1.1
-- @add singleTap event
-- @fix doubleTap event
-- @fix hold event
@vitalyrotari
vitalyrotari / Custom.css
Created November 6, 2012 05:50
Chrome DevTool Color Theme
/**********************************************/
/*
/* enlightened Theme for Chrome DevTools by Vincent Mac
/* Forked from mnml Theme for Chrome DevTools by Michael P. Pfeiffer
/*
/**********************************************/
#-webkit-web-inspector #main {
background-color: #1d1f21 !important;
}
#-webkit-web-inspector tr {