Skip to content

Instantly share code, notes, and snippets.

@klange
Last active Jun 8, 2022
Embed
What would you like to do?
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at least...) support both of these features in their default configurations.
  • Since it's been mentioned by multiple people, I used timestamps instead of building struct tms as a stylistic choice.
  • As a final reminder, this is a joke.
#include <stdio.h>
#include <time.h>
typedef struct {
union {
const char * company;
const char * school;
const char * project;
};
union {
const char * location;
const char * url;
};
union {
const char * title;
const char * program;
};
time_t started;
time_t left;
const char * description[];
} thing_t;
typedef thing_t job_t;
typedef thing_t school_t;
typedef thing_t project_t;
#define CURRENT 0 /* I wasn't alive at the Unix epoch, so that'll work */
/* Contact Information */
const char * name = "K. Lange";
const char * email = "klange@toaruos.org";
const char * address = "3-5-19-903 Kotobashi, Sumida\n"
"Tokyo, Japan 130-0022";
/* Education */
school_t uiuc = {
.school = "University of Illinois at Urbana-Champaign",
.location = "Urbana, IL",
.program = "BS Computer Science",
.started = 1251158400,
.left = 1336608000,
.description = {
"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,
.description = {
"Cultural exchange program",
"Intensive language course",
NULL
}
};
school_t * schools[] = {
&uiuc,
&hit,
NULL
};
/* Projects */
project_t compiz = {
.project = "Compiz Window Manager",
.url = "http://compiz.org",
.title = "Developer",
.started = 1201392000,
.left = 1264291200,
.description = {
"Minor plugin contributor",
"Various research projects",
NULL
}
};
project_t toaruos = {
.project = "ToAruOS",
.url = "https://github.com/klange/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,
.description = {
"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,
.description = {
"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
};
void print_thing(thing_t * thing) {
char started[100];
char left[100];
struct tm * ti;
printf("%s at %s - %s\n", thing->title, thing->company, thing->location);
ti = localtime(&thing->started);
strftime(started, sizeof(started), "%B %d, %Y", ti);
if (thing->left == CURRENT) {
printf("%s to now\n", started);
} else {
ti = localtime(&thing->left);
strftime(left, sizeof(left), "%B %d, %Y", ti);
printf("%s to %s\n", started, left);
}
const char ** desc;
for (desc = thing->description; *desc; desc++) {
printf("- %s\n", *desc);
}
puts("");
}
int main(int argc, char ** argv) {
school_t ** s;
job_t ** j;
project_t ** p;
printf("%s\n%s\n%s\n\n", name, email, address);
puts("Education\n");
for (s = schools; *s; s++) {
print_thing(*s);
}
puts("Employment\n");
for (j = jobs; *j; j++) {
print_thing(*j);
}
puts("Projects\n");
for (p = projects; *p; p++) {
print_thing(*p);
}
return 0;
}
@cyberis
Copy link

cyberis commented Mar 17, 2015

Very creative. Clean style. I'd probably hire you.

@gravitino
Copy link

gravitino commented Mar 17, 2015

@AndreasOM We don't take advice from Ruby programmers.

@napolux
Copy link

napolux commented Mar 17, 2015

Nice CV! 💫

@warmwaffles
Copy link

warmwaffles commented Mar 17, 2015

Love it

@enthouan
Copy link

enthouan commented Mar 17, 2015

Very funny.

It would be perfect if the global variables and the print_thing were static.

@Ham5ter
Copy link

Ham5ter commented Mar 17, 2015

I realy Like this Idea! 😃

@manvscode
Copy link

manvscode commented Mar 17, 2015

Beautiful! I would love to see a recruiter's face when given the source code. Unfortunately, you probably won't get a lot of offers since HR and staffing firms are the gate keepers. This is a problem all of us need to get behind and solve.

@pcreech
Copy link

pcreech commented Mar 17, 2015

Awesome.

@gabrielfalcao
Copy link

gabrielfalcao commented Mar 17, 2015

beautiful code

@lethalman
Copy link

lethalman commented Mar 17, 2015

Too serious... really. I expected some nice horizontal ruler, some ascii art... vote 3/10.

@helloweishi
Copy link

helloweishi commented Mar 18, 2015

nice C

@overtrue
Copy link

overtrue commented Mar 18, 2015

👍

@smaquois123
Copy link

smaquois123 commented Mar 18, 2015

And all this time I've been sending out my resume in assembly.

@brainix
Copy link

brainix commented Mar 18, 2015

Code Golf / IOCCC it and force the recruiter to compile and run it to see what it says?

@gansidui
Copy link

gansidui commented Mar 18, 2015

niubility

@jLukeC
Copy link

jLukeC commented Mar 18, 2015

Pretty great project. I tried to replicate something similar in OCaml here

@youran1024
Copy link

youran1024 commented Mar 19, 2015

wonderful~

@ameizi
Copy link

ameizi commented Mar 19, 2015

Cool~

@hoangddt
Copy link

hoangddt commented Mar 19, 2015

Beauty!

@michals
Copy link

michals commented Mar 19, 2015

I wrote similar cv.c nine years ago when starting in Lucent-Technologies. HR person was bit confused but technical folks liked it.

@sillykelvin
Copy link

sillykelvin commented Mar 19, 2015

Nice job, but failed to compile(gcc resume.c), gcc version:

gcc (GCC) 4.4.6 20110731 (Red Hat 4.4.6-4)

error:

resume.c:39: error: unknown field 'school' specified in initializer
resume.c:40: error: unknown field 'location' specified in initializer
resume.c:41: error: unknown field 'program' specified in initializer
resume.c:52: error: unknown field 'school' specified in initializer
resume.c:53: error: unknown field 'location' specified in initializer
resume.c:54: error: unknown field 'program' specified in initializer
resume.c:72: error: unknown field 'project' specified in initializer
resume.c:73: error: unknown field 'url' specified in initializer
resume.c:74: error: unknown field 'title' specified in initializer
resume.c:85: error: unknown field 'project' specified in initializer
resume.c:86: error: unknown field 'url' specified in initializer
resume.c:87: error: unknown field 'title' specified in initializer
resume.c:106: error: unknown field 'company' specified in initializer
resume.c:107: error: unknown field 'location' specified in initializer
resume.c:108: error: unknown field 'title' specified in initializer
resume.c:119: error: unknown field 'company' specified in initializer
resume.c:120: error: unknown field 'location' specified in initializer
resume.c:121: error: unknown field 'title' specified in initializer

I missed something?

@Anye
Copy link

Anye commented Mar 19, 2015

Thanks HR doesn't give up this wonderful resume.

@cplusProgrammer
Copy link

cplusProgrammer commented Mar 20, 2015

nice :)

@pravinkerai212
Copy link

pravinkerai212 commented Mar 21, 2015

mind blowing!!

@lichengwu
Copy link

lichengwu commented Mar 22, 2015

good!

@luftreich
Copy link

luftreich commented Apr 3, 2015

nice !

@zabesangary
Copy link

zabesangary commented Jun 22, 2015

Troll!

Copy link

ghost commented Jan 6, 2016

void print_thing(thing_t * thing) {
char started[100];
char left[100]
...
}

That stack looks gigantic. What if you make those arrays static?

Beautiful code btw. I'm curious about the puts("") at the end of print_thing though, what's it for?

@youthlin
Copy link

youthlin commented Jan 10, 2016

amazing.可怕。

@ssdr
Copy link

ssdr commented Feb 4, 2016

good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment