Skip to content

Instantly share code, notes, and snippets.

View chiemseesurfer's full-sized avatar

Max Oberberger chiemseesurfer

View GitHub Profile
@chiemseesurfer
chiemseesurfer / validate_crontab_time_format.py
Last active May 4, 2017 14:05 — forked from harshithjv/validate_crontab_time_format.py
Python Regex object to validate crontab entry time format string.
"""
Referred from stackoverflow question: http://stackoverflow.com/questions/235504/validating-crontab-entries-w-php
"""
validate_crontab_time_format_regex = re.compile(\
"{0}\s+{1}\s+{2}\s+{3}\s+{4}".format(\
"(?P<minute>\*(\/[0-5]?\d)?|[0-5]?\d)",\
"(?P<hour>\*|[01]?\d|2[0-3])",\
"(?P<day>\*|0?[1-9]|[12]\d|3[01])",\
"(?P<month>\*|0?[1-9]|1[012])",\
@chiemseesurfer
chiemseesurfer / header.html
Last active August 29, 2015 14:15
Switch between screen and mobile view with javascript
<script>
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
var cssUrl = "media/css/handheld.css";
var head = document.getElementsByTagName("head")[0];
var link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";