Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| // For Zig 0.12 | |
| const std = @import("std"); | |
| const net = std.net; | |
| const ArenaAllocator = std.heap.ArenaAllocator; | |
| pub fn main() anyerror!void { | |
| var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
| const allocator = gpa.allocator(); |
All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.
| const std = @import("std"); | |
| const net = std.net; | |
| const fs = std.fs; | |
| const os = std.os; | |
| pub const io_mode = .evented; | |
| pub fn main() anyerror!void { | |
| var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; | |
| const allocator = &general_purpose_allocator.allocator; |
| <?php | |
| function compileCPP(string $sourcePath, string $binaryPath): bool { | |
| $descriptorspec = [ | |
| 0 => ['pipe', 'r'], | |
| 1 => ['pipe', 'w'], | |
| 2 => ['pipe', 'w'] | |
| ]; | |
| $cwd = '/tmp'; |
| var net = require('net'); | |
| var sockets = []; | |
| var port = 8000; | |
| var guestId = 0; | |
| var server = net.createServer(function(socket) { | |
| // Increment | |
| guestId++; | |
| socket.nickname = "Guest" + guestId; |
| <?php | |
| // from http://www.if-not-true-then-false.com/2010/php-class-for-coloring-php-command-line-cli-scripts-output-php-output-colorizing-using-bash-shell-colors/ | |
| class Colors { | |
| private $foreground_colors = array(); | |
| private $background_colors = array(); | |
| public function __construct() { | |
| // Set up shell colors | |
| $this->foreground_colors['black'] = '0;30'; | |
| $this->foreground_colors['dark_gray'] = '1;30'; |