Skip to content

Instantly share code, notes, and snippets.

View pierswarmers's full-sized avatar
🏡
Working remotely since 2018

Piers Warmers pierswarmers

🏡
Working remotely since 2018
View GitHub Profile
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
@pierswarmers
pierswarmers / regions.xml
Created December 20, 2010 21:57
A simple list of countries and regions.
<?xml version="1.0" encoding="UTF-8"?>
<countries>
<country iso2="AF">
<state>Badakhshan</state>
<state>Badghis</state>
<state>Baghlan</state>
<state>Bamian</state>
<state>Farah</state>
<state>Faryab</state>
<state>Ghazni</state>