Skip to content

Instantly share code, notes, and snippets.

@tzuryby
Forked from klange/_.md
Last active August 29, 2015 14:17
Show Gist options
  • Save tzuryby/894b413eae1ca8594d6b to your computer and use it in GitHub Desktop.
Save tzuryby/894b413eae1ca8594d6b to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <time.h>
/* TODO: resume.h */
typedef struct {
char * company;
char * location;
char * title;
time_t started;
time_t left;
char * accomplishments[];
} job_t;
typedef struct {
char * school;
char * location;
char * program;
time_t started;
time_t left;
char * accomplishments[];
} school_t;
typedef struct {
char * project;
char * title;
time_t started;
time_t left;
char * description[];
} project_t;
#define CURRENT 0 /* I wasn't alive at the Unix epoch, so that'll work */
/* Contact Information */
char * name = "Kevin R. Lange";
char * email = "klange@toaruos.org";
char * address = "1045 Mission St, Apt 440\n"
"San Francisco, CA 94103";
/* Education */
school_t uiuc = {
.school = "University of Illinois at Urbana-Champaign",
.location = "Urbana, IL",
.program = "BS Computer Science",
.started = 1251158400,
.left = 1336608000,
.accomplishments = {
"Minor in International Studies in Engineering, Japan",
"Focused on systems software courses",
NULL
}
};
school_t hit = {
.school = "Hiroshima Institute of Technology",
.location = "Hiroshima, Japan",
.program = "Study Abroad",
.started = 1274745600,
.left = 1278288000,
.accomplishments = {
"Cultural exchange program",
NULL
}
};
school_t * schools[] = {
&uiuc,
&hit,
NULL
};
/* Projects */
project_t compiz = {
.project = "Compiz Window Manager",
.title = "Developer",
.started = 1201392000,
.left = 1264291200,
.description = {
"Minor plugin contributor",
"Various research projects",
NULL
}
};
project_t toaruos = {
.project = "ToAruOS",
.title = "Lead",
.started = 1295049600,
.left = CURRENT,
.description = {
"Hobby x86 Unix-like kernel and userspace",
"Advanced in-house GUI with compositing window manager",
NULL
}
};
project_t * projects[] = {
&toaruos,
&compiz,
NULL
};
/* Employment History */
job_t yelp = {
.company = "Yelp, Inc.",
.location = "San Francisco, CA",
.title = "Software Engineer, i18n",
.started = 1339977600,
.left = CURRENT,
.accomplishments = {
"Developed several internal tools and libraries",
"Provided critical input and design work for Yelp's launch in Japan",
NULL
}
};
job_t apple_internship = {
.company = "Apple Inc.",
.location = "Cupertino, CA",
.title = "Software Engineering Intern",
.started = 1306886400,
.left = 1314662400,
.accomplishments = {
"Built software framework for testing and verification of desktop retina display modes",
"Assisted other interns with Unix fundamentals",
NULL
}
};
job_t * jobs[] = {
&yelp,
&apple_internship,
NULL
};
/* TODO: resume-main.c */
void print_job(job_t * job) {
char started[100];
char left[100];
struct tm * ti;
int i = 0;
printf("%s at %s in %s\n", job->title, job->company, job->location);
ti = localtime(&job->started);
strftime(started, 100, "%B %d, %Y", ti);
if (job->left == CURRENT) {
printf("%s to now\n", started);
} else {
ti = localtime(&job->left);
strftime(left, 100, "%B %d, %Y", ti);
printf("%s to %s\n", started, left);
}
while (job->accomplishments[i]) {
printf("- %s\n", job->accomplishments[i]);
++i;
}
}
void print_school(school_t * school) {
char started[100];
char left[100];
struct tm * ti;
int i = 0;
printf("%s at %s in %s\n", school->program, school->school, school->location);
ti = localtime(&school->started);
strftime(started, 100, "%B %d, %Y", ti);
if (school->left == CURRENT) {
printf("%s to now\n", started);
} else {
ti = localtime(&school->left);
strftime(left, 100, "%B %d, %Y", ti);
printf("%s to %s\n", started, left);
}
while (school->accomplishments[i]) {
printf("- %s\n", school->accomplishments[i]);
++i;
}
}
int main(int argc, char ** argv) {
printf("%s\n%s\n%s\n\n", name, email, address);
puts("Education\n");
school_t ** s = schools;
while (*s) {
print_school(*s);
puts("");
s++;
}
puts("Employment\n");
job_t ** j = jobs;
while (*j) {
print_job(*j);
puts("");
j++;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment