Skip to content

Instantly share code, notes, and snippets.

View krig's full-sized avatar
🏠
Working from home

Kristoffer Grönlund krig

🏠
Working from home
View GitHub Profile
@krig
krig / parseiso8601utc.c
Created February 20, 2013 09:32
Function to parse an ISO 8601 string with timezone suffix Z (UTC) to a time_t value.
#include <time.h>
/* parses only YYYY-MM-DDTHH:MM:SSZ */
time_t parseiso8601utc(const char *date) {
struct tm tt = {0};
double seconds;
if (sscanf(date, "%04d-%02d-%02dT%02d:%02d:%lfZ",
&tt.tm_year, &tt.tm_mon, &tt.tm_mday,
&tt.tm_hour, &tt.tm_min, &seconds) != 6)
return -1;
@krig
krig / .phrdict
Created January 21, 2013 22:15
Dictionary of the most common english words
the be and of a in to have to it I that for you he with on do say this
they at but we his from that not n't n't by she or as what go their
can who get if would her all my make about know will as up one time
there year so think when which them some me people take out into just
see him your come could now than like other how then its our two more
these want way look first also new because day more use no man find
here thing give many well only those tell one very her even back any
good woman through us life child there work down may after should call
world over school still try in as last ask need too feel three when
state never become between high really something most another much