Skip to content

Instantly share code, notes, and snippets.

View whaleinvasion's full-sized avatar
💭
I may be slow to respond.

WhaleInvasion whaleinvasion

💭
I may be slow to respond.
View GitHub Profile
@whaleinvasion
whaleinvasion / touch-detect.js
Created October 2, 2018 11:51 — forked from seafoox/touch-detect.js
Detecting the ‘Tap’ event on a Mobile touch device using javascript --- JSFiddle: http://jsfiddle.net/gianlucaguarini/56Szw/light/
var $touchArea = $('#touchArea'),
touchStarted = false, // detect if a touch event is sarted
currX = 0,
currY = 0,
cachedX = 0,
cachedY = 0;
//setting the events listeners
$touchArea.on('touchstart mousedown',function (e){
e.preventDefault();
@whaleinvasion
whaleinvasion / daemon.js
Created July 14, 2021 22:19 — forked from kumatch/daemon.js
Node.js daemon example
var fs = require('fs');
var INTERVAL = 1000;
var cycle_stop = false;
var daemon = false;
var timer;
process.argv.forEach(function (arg) {
if (arg === '-d') daemon = true;