Skip to content

Instantly share code, notes, and snippets.

View Silvery-Corgan's full-sized avatar

Sorin-Mihai Oprea Silvery-Corgan

  • IPSoft Netherlands B.V.
  • Amsterdam, NL
View GitHub Profile
@andrelaszlo
andrelaszlo / personnummer.js
Created June 26, 2012 13:54
Function that checks if a swedish personnummer is valid
/*
* Function that checks if a swedish personnummer is valid.
* Author: André Laszlo <andre@laszlo.nu>
*/
function check_personnummer(pnr) {
// Do formatting and sanity control
pnr = pnr.replace(/[^0-9]/g, ''); // only keep digits
if (12 == pnr.length) // year format 1985 → 85
pnr = pnr.substr(2);
@n8v
n8v / check_backup.pl
Created September 14, 2011 23:16
Nagios Plugin for checking a backup file for existence, age and size.
#!/usr/bin/perl
### check_backup.pl
# By Nathan Vonnahme, Sept 2011
# An example for "Writing Custom Nagios Plugins in Perl" at the Nagios
# World Conference North America 2011.
# I. Prologue