Skip to content

Instantly share code, notes, and snippets.

View vikaskanani's full-sized avatar

Vikas Patel vikaskanani

View GitHub Profile
@vikaskanani
vikaskanani / cleanEmptyFoldersRecursively.js
Last active June 13, 2017 07:19 — forked from jakub-g/cleanEmptyFoldersRecursively.js
nodejs: remove empty directories recursively which are older than 2 days
function cleanEmptyFoldersRecursively(folder) {
var fs = require('fs');
var path = require('path');
var folderStat = fs.statSync(folder);
var isDir = folderStat.isDirectory();
if (!isDir) {
return;
}
<cfdump var="#TimeSlot(Minutslot = 15)#" />
<cffunction name="TimeSlot" output="false" access="public" returntype="any">
<cfargument name="Minutslot" type="numeric" required="true">
<cfif 1440 MOD arguments.Minutslot NEQ 0>
<cfthrow type="user" message="Invalid Minute slot">
</cfif>
<cfset var i = 0>