The TTY Demystified
http://www.linusakesson.net/programming/tty/
Beej's Guide to Network Programming
The TTY Demystified
http://www.linusakesson.net/programming/tty/
Beej's Guide to Network Programming
| #ifndef HEX_HEX_H | |
| #define HEX_HEX_H | |
| #include <stdlib.h> | |
| enum hex_err_e { | |
| HEX_OK, | |
| HEX_ENOMEM, | |
| HEX_EBOUNDS, | |
| HEX_EBADSPACE, |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define BOARD_WIDTH 11 | |
| #define BOARD_HEIGHT 11 | |
| #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) | |
| #define TRAVERSE_DIRECTION(iterator, source, direction) \ | |
| for (iterator = source; iterator != NULL; \ | |
| iterator = iterator->edges[direction]) |
| #include <stdio.h> | |
| /* each line along which a player can win */ | |
| enum axes { | |
| HORIZ_TOP, | |
| HORIZ_MID, | |
| HORIZ_BOT, | |
| VERT_LEFT, | |
| VERT_MID, | |
| VERT_RIGHT, |
| // compile with `gcc wav-pulse-example.c -lpulse-simple -lpulse -o wav-pulse-example` | |
| // run with `./wav-pulse-example <path_to_wav_file>` | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| // install dev libs from package "pulseaudio-libs-devel" (rpm) or "libpulse-dev" (deb) | |
| #include <pulse/simple.h> | |
| #include <pulse/error.h> |
| setopt +o nomatch | |
| NEWLINE=$'\n' | |
| source ~/.profile | |
| show_git_branch () { | |
| local desc=$(git symbolic-ref --short HEAD 2>/dev/null) | |
| [[ -z "$desc" ]] && desc=$(git rev-parse --short HEAD 2>/dev/null) | |
| [[ -z "$desc" ]] && return |
| #!/bin/bash | |
| # Output an analog clock for the current time. | |
| # Rounded to the nearest half-hour. | |
| (( clock = $(date +"%I") + 143 )) | |
| if [[ $(date +"%M") > 45 ]]; then | |
| (( clock ++ )) | |
| [[ $clock > 152 ]] && (( clock = 144 )) | |
| elif [[ $(date +"%M") > 15 ]]; then | |
| (( clock += 12 )) |