I hereby claim:
- I am mikl on github.
- I am mikl (https://keybase.io/mikl) on keybase.
- I have a public key ASAIWHSQKo6M5T4c3YhvSvdtldwPqEjRecLbvOrUQ7y3uwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/* | |
Copyright (c) 2014, Mikkel Hoegh <[email protected]> | |
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. | |
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
*/ | |
var Hapi = require('hapi'); | |
var Joi = require('joi'); |
if (typeof Date.prototype.setISODate !== 'function') { | |
// Crude validation for the date input. | |
var dateValidator = /^\d\d\d\d-[01]\d-[0-3]\d$/; | |
/** | |
* Set date from a ISO-formatted string, ie. 2011-11-28. | |
*/ | |
Date.prototype.setISODate = function (input) { | |
if (dateValidator.test(input)) { | |
var parts = input.split('-'); |
<?php | |
/* | |
THE EMOGRIFIER LICENSE | |
Copyright (c) 2008-2011 Pelago (http://www.pelagodesign.com/) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
<?php | |
// $Id$ | |
/** | |
* @file | |
* This is a dump of the session node type from the DrupalCon Copenhagen site. | |
*/ | |
$content['type'] = array ( |
-- Select the fields we need. | |
SELECT u.uid AS uid, | |
u.name AS username, | |
TRIM(n.title) AS real_name, | |
ctp.field_profile_nametag_value AS nametag_name, | |
ctp.field_profile_company_value AS company, | |
ctp.field_profile_drupal_value AS drupal_org_name, | |
ctp.field_profiler_do_uid_value AS drupal_org_uid, | |
ctp.field_profiler_twitter_value AS twitter_name, | |
ctp.field_profile_country_value AS country, |
-- Alias all the fields we want. | |
SELECT cts.field_session_day_value AS session_day, | |
cts.field_session_time_value AS session_time, | |
cts.field_session_room_value AS session_room, | |
n.title AS session_title, | |
pn.title AS presenter_name, | |
td.name AS track_name | |
-- Start with the session table | |
FROM content_type_session AS cts | |
-- Get the main node data to eliminate unpublished nodes and the author uid. |
%s/\vtlf. (\d+) (\d+),/\1\2,/gc | |
%s/, e-mail /,/gc | |
%s/\v, (\d\d\d\d) ([A-ZÆØÅÉ])/,\1,\2/gc | |
%s/\v^([a-zA-Z0-9.'æøåÆØÅéü' &\/\(\)-]+) (\d+),/\1, \2,/gc | |
%s/, \+/,/gc | |
%s/,/;/g | |
%s/\v^([^;]+);([^;]+) (\d\d\d\d\d\d)/\1, \2;\3/gc | |
%s/\v^([^;]+;[^;]+;[^;]+);([^;]+;\d\d\d\d)/\1, \2/g |