Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
#include <stdio.h> | |
#include <stdlib.h> | |
#include <libproc.h> | |
// Uses proc_pidinfo from libproc.h to find the parent of given pid. | |
// Call this repeatedly until ppid(pid) == pid to get ancestors. | |
int ppid(pid_t pid) { | |
struct proc_bsdinfo info; | |
proc_pidinfo(pid, PROC_PIDTBSDINFO, 0, &info, sizeof(info)); | |
return info.pbi_ppid; |
<?php | |
// This file walks you through the most common features of PHP's SQLite3 API. | |
// The code is runnable in its entirety and results in an `analytics.sqlite` file. | |
// Create a new database, if the file doesn't exist and open it for reading/writing. | |
// The extension of the file is arbitrary. | |
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE); | |
// Errors are emitted as warnings by default, enable proper error handling. |
/* | |
* As of May 25 2021, this code is provided as CC0 / public domain (Kazuho Oku) | |
* | |
* Copyright (c) 2014 Kazuho Oku | |
* | |
* Redistribution and use in source and binary forms, with or without modification, | |
* are permitted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |