$ npm install
$ npm start
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
int main() { | |
const int n_processes = 5; | |
pid_t pid; |
#include <stdio.h> | |
#include <unistd.h> | |
#include <stdbool.h> | |
/* https://www.gnu.org/software/libc/manual/html_node/Example-of-Getopt.html */ | |
int main(int argc, char* argv[]) { | |
bool is_a = false; | |
bool is_b = false; | |
bool is_c = false; | |
char* value_b = ""; |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
/** | |
* Find ipv4 addresses (tcp) associated with given hostname |
#include <stdio.h> | |
/* Inspired by: https://hackaday.com/2022/03/16/linux-fu-simple-pipes/ */ | |
int main() { | |
// creates a pipe between calling pgm & executed command (`ls`) and | |
// returns a stream to read from the pipe | |
FILE* pipe = popen("ls -l", "r"); | |
// read the output of shell command from stream | |
char buffer[64]; |
#include <stdio.h> | |
#include <time.h> | |
#include <math.h> | |
/* https://www.educative.io/edpresso/what-is-clockt-in-c */ | |
int main() { | |
clock_t start_ticks = clock(); | |
size_t n_iters = pow(10, 9); | |
for (size_t i = 0; i < n_iters; i++) { |
git log --pretty=format:'%ad - %s' --date=human |
// file: src/main.cpp | |
#include <iostream> | |
#include "glad/glad.h" | |
#include "window.hpp" | |
#include "nanovg.h" | |
#define NANOVG_GL3_IMPLEMENTATION | |
#include "nanovg_gl.h" |
From this [Stackoverflow question][stackoverflow]:
$DISPLAY
variable.