Skip to content

Instantly share code, notes, and snippets.

View manast's full-sized avatar

Manuel Astudillo manast

View GitHub Profile
@emanuelet
emanuelet / rtoc.js
Last active September 29, 2023 22:22
Convert RRULE string to Cron expression (with output for Bull Repeated jobs)
const moment = require('moment-timezone')
const logger = require('tracer').colorConsole()
const { RRule, RRuleSet, rrulestr } = require('rrule')
function untilStringToDate(until) {
const re = /^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z?)?$/
const bits = re.exec(until)
if (!bits) throw new Error(`Invalid UNTIL value: ${until}`)
@squidrpi
squidrpi / linux_sync
Last active December 24, 2023 03:29
MIST FPGA update scripts
#!/bin/bash
# Pass directory to sync to SD card as parameter 1
# Mounts & syncs any directory in current directory
# to an SD card that is named the same as the directory.
# Also sets special file settings on the SD card so that
# MIST displays them correctly.
if [ $USER != root ]; then
echo "Must be run as root!"
exit 1