Skip to content

Instantly share code, notes, and snippets.

View AlexEmashev's full-sized avatar
🔰
Come code with me...

Alexander Emashev AlexEmashev

🔰
Come code with me...
  • Metamins
  • Nizhny Novgorod, Russian Federation
View GitHub Profile
@AlexEmashev
AlexEmashev / swipe-detect.js
Last active August 17, 2023 09:54
Simple snippet to detect swipe in jQuery without jQuery mobile. Works for touch as well as mouse input.
// Demo http://codepen.io/AlexEmashev/pen/BKgQdx
(function ($) {
$.fn.swipeDetector = function (options) {
// States: 0 - no swipe, 1 - swipe started, 2 - swipe released
var swipeState = 0;
// Coordinates when swipe started
var startX = 0;
var startY = 0;
// Distance of swipe
var pixelOffsetX = 0;
@AlexEmashev
AlexEmashev / nodejs-cheatsheet.js
Created March 22, 2022 12:44 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html