A programmer puts two glasses on his
bedside table before going to sleep.
- A full one, in case he gets thirsty,
and an empty one, in case he doesn’t.
01.07.2024 05:19:04
A programmer puts two glasses on his
bedside table before going to sleep.
01.07.2024 05:19:04
// date time handling | |
pub const DateTime = struct { | |
day: u8, | |
month: u8, | |
year: u16, | |
hour: u8, | |
minute: u8, | |
second: u8, | |
}; |
The url that is being returned by aws s3.PresignClient
:
"http://localhost:9000/bucket-name/bucket-key?
X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=minioadmin%2F20231127%2Feu-west-1%2Fs3%2Faws4_request
&X-Amz-Date=20231127T163354Z
&X-Amz-Expires=900
&X-Amz-SignedHeaders=expires%3Bhost
&x-id=PutObject
&X-Amz-Signature=b187cc4d700e46a3b6e381a37a334e604cc782fe9a544051e8e411ac23316a6e"
const std = @import("std"); | |
const time = std.time; | |
pub fn main() !void { | |
var timespec = std.os.timespec{ | |
.tv_sec = 0, | |
.tv_nsec = 0, | |
}; | |
std.debug.print("\n\n{any}\n\n", .{timespec}); | |
try std.os.clock_gettime(std.os.CLOCK.REALTIME, ×pec); |
const std = @import("std"); | |
pub fn main() !void { | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
defer _ = gpa.deinit(); | |
const allocator = gpa.allocator(); | |
const args = try std.process.argsAlloc(allocator); | |
defer std.process.argsFree(allocator, args); |
const std = @import("std"); | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
const alloc = gpa.allocator(); | |
pub fn main() !void { | |
var distance: i32 = 7857; | |
var str = std.fmt.allocPrint( | |
alloc, | |
"test alloc: {d}", | |
.{distance}, |
const std = @import("std"); | |
const http = std.http; | |
const Client = http.Client; | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
const calloc = gpa.allocator(); | |
pub fn main() !void { | |
// get token and gist id from .envrc file (get ENV VAR) | |
const token = std.os.getenv("GH_TOKEN") orelse ""; |
// zig version 0.10.1 | |
const std = @import("std"); | |
const net = std.net; | |
const mem = std.mem; | |
const log = std.log; | |
const stdout = std.io.getStdOut().writer(); | |
const BUFSIZE = 8192; | |
const HTTPHEAD = |
const std = @import("std"); | |
const stdout = std.io.getStdOut().writer(); | |
const stdin = std.io.getStdIn().reader(); | |
pub fn main() anyerror!void { | |
var buf = std.io.bufferedReader(stdin); | |
// Get the Reader interface from BufferedReader | |
var r = buf.reader(); |