Skip to content

Instantly share code, notes, and snippets.

View malcolmb's full-sized avatar

Malcolm Boyanton malcolmb

View GitHub Profile
@malcolmb
malcolmb / find-crontabs.sh
Created August 6, 2013 13:22
Find all user crontabs.
# Taken from http://stackoverflow.com/a/134944/462170
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@malcolmb
malcolmb / path-fix.sh
Created June 7, 2013 13:28
Bash replace script for ecms_mockup.
#!/bin/bash
for fl in *.php; do
mv $fl $fl.old
sed 's/\/Users\/malcolm\/Sites/\/home\/newhaven\/public_html/g' $fl.old > $fl
rm -f $fl.old
done
@malcolmb
malcolmb / vosges_date.php
Last active December 17, 2015 10:29
Vosges Date Fix
<?php
function dateloop($current){
$holidays = array('2013-05-17');
$date = date('Y-m-d', $current);
if(date('G', $current) > 15) {
$current = mktime(0, 0, 0, date("m", $current) , date("d", $current)+1, date("Y", $current));
echo "after 2pm, advancing one day\n";
$next = date($current);
return dateloop($next);