This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 2025 vseryakov@gmail.com Vlad Seryakov | |
// | |
// A simple cron formatter, only supports *, numbers or ranges | |
// | |
function cron_format(str) | |
{ | |
var cron = String(str).split(" "). | |
map(x => x.trim()). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local name = KEYS[1]; | |
local rate = tonumber(KEYS[2]); | |
local max = tonumber(KEYS[3]); | |
local interval = tonumber(KEYS[4]); | |
local now = tonumber(KEYS[5]); | |
local count = tonumber(redis.call('HGET', name, 'count')); | |
local mtime = tonumber(redis.call('HGET', name, 'mtime')); | |
if not mtime then | |
count = max; | |
mtime = now; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
var url = require('url'); | |
var https = require('https'); | |
var qs = require('querystring'); | |
var data = ""; | |
process.stdin.resume(); | |
process.stdin.on('data', function (chunk) { data += String(chunk); }); | |
process.stdin.on('end', function() { |