Skip to content

Instantly share code, notes, and snippets.

View klange's full-sized avatar
🤔
Contemplative.

K Lange klange

🤔
Contemplative.
View GitHub Profile
$ cloc kernel/ userspace/ util/ Makefile toaru.terminfo TODO.md
166 text files.
166 unique files.
3 files ignored.
http://cloc.sourceforge.net v 1.53 T=1.0 s (163.0 files/s, 27886.0 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
C 112 2667 3247 16973
http://cloc.sourceforge.net v 1.53 T=119.0 s (230.2 files/s, 77518.1 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
C 6891 538988 602074 3423676
Bourne Shell 641 142457 126441 854545
C/C++ Header 3854 144453 228529 647084
D 4045 15779 0 569639
Assembly 4654 43819 27859 522570
C++ 5145 66990 113326 269603
@klange
klange / git-contrib-all.sh
Created October 23, 2012 22:40
List the +/- contribution of a user for a particular branch
$ git-contributions "Kevin Lange"
master Kevin Lange +71133 -43564
$ git-contrib-all
master Kevin Lange +71133 -43564
master Markus Schober +3922 -1071
master Tianyi Wang +775 -212
#include <stdio.h>
#include <stdint.h>
typedef uint8_t u8;
#define TILE_WIDTH 8
#define TILE_HEIGHT 8
#define TILE_SIZE (TILE_WIDTH * TILE_HEIGHT)
typedef u8 tile_t[TILE_SIZE];
@klange
klange / _.md
Last active May 23, 2024 13:45
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 le
$ clang -m32 -o test test.c
$ file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0xa8c4554a9af45891a710cd4cbaaeaeb45e2e9bfb, not stripped
$ ./test
Hello world
$
/*
* build with:
* gcc -o bitmap bitmap.c
* or maybe you'd prefer:
* g++ -o bitmap bitmap.c
* I really don't care, it'll work in anything:
* clang -o bitmap bitmap.c
*/
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define MAX_LINES 100
#define MAX_LEN 1024
int main(int argc, char * argv) {
char * lines[MAX_LINES];
int lines_collected = 0;
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("jenkins.yelpcorp.com") {
.SUCCESS *, .SUCCESS {
background-color: #333 !important;
color: #DEDEDE !important;
font-weight: 200 !important;
}
.FAILURE *, .FAILURE {
background-color: #a00 !important;
@klange
klange / example.c
Last active December 13, 2015 19:39
/*
* TTK Demonstration Caclulator
*
* This is non-functional mockup code for a calculator.
* The current goal of TTK development is to turn this
* into functioning code with as few changes to this
* code as possible.
*
*/
#include "gui/ttk/ttk.h"