display: flex;
A short cheatsheet for flexbox. Assembled from w3schools and [MDN][2].
| const Errors = error{ | |
| hello, | |
| world, | |
| }; | |
| // It's a tagged union, expect the tag is an error set | |
| const ErrorUnion = union(Errors) { | |
| hello: u32, | |
| world: []const u8, | |
| }; |
| new f4a0c58216b9dad9 const_slice_u8 "typedef struct { uint8_t const * ptr; size_t len; } zig_L_u8;\n" | |
| new fd5814f465beb2c5 tuple "typedef struct {\n uintptr_t field_0;\n uint8_t field_1;\n} zig_T_tuple_7busize_2c_20u1_7d;\n" | |
| new 8d02975f3a25a947 array_u8_sentinel_0 "typedef uint8_t zig_A_u8_5[5];\n" | |
| new d5d7770a0890948e array_u8 "typedef uint8_t zig_A_u8_1[1];\n" | |
| f4a0c58216b9dad9 const_slice_u8 "typedef struct { uint8_t const * ptr; size_t len; } zig_L_u8;\n" | |
| new 4487d943b4f83aed array_u8_sentinel_0 "typedef uint8_t zig_A_u8_1[1];\n" | |
| f4a0c58216b9dad9 const_slice_u8 "typedef struct { uint8_t const * ptr; size_t len; } zig_L_u8;\n" | |
| f4a0c58216b9dad9 const_slice_u8 "typedef struct { uint8_t const * ptr; size_t len; } zig_L_u8;\n" | |
| new 25da5e8e385153e6 single_const_pointer "typedef uint16_t (*zig_F__2aconst_20fn_28_29_20anyerror_21void)(void);\n" | |
| new 3b32fc1c5510a94 optional "typedef struct { uintptr_t payload; bool is_null; } zig_Q_usize |
| const std = @import("std"); | |
| pub fn parent(idx: u32) u32 { | |
| std.debug.assert(idx > 0); | |
| return (idx - 1) / 2; | |
| } | |
| pub fn left(idx: u32) u32 { | |
| return 2 * idx + 1; | |
| } |
| const std = @import("std"); | |
| pub fn main() !void { | |
| const argv = try std.process.argsAlloc(std.heap.page_allocator); | |
| defer std.process.argsFree(std.heap.page_allocator, argv); | |
| const result = forth("a b +", .{ | |
| .a = try std.fmt.parseInt(i32, argv[1], 10), | |
| .b = try std.fmt.parseInt(i32, argv[2], 10), | |
| }); |
| begin | |
| set_fill_style(FillStyle{ .Color = Color{ .r = 255, .g = 255, .b = 255, .a = 255 } }) | |
| fill_rect(0, 0, 640, 480) | |
| set_stroke_style(FillStyle{ .Color = Color{ .r = 204, .g = 204, .b = 204, .a = 255 } }) | |
| set_line_cap(LineCap.square) | |
| set_line_width(1.5) | |
| set_line_dash(f32@7ffde74f5c18) | |
| set_fill_style(FillStyle{ .Color = Color{ .r = 100, .g = 100, .b = 100, .a = 255 } }) | |
| set_fill_style(FillStyle{ .Color = Color{ .r = 100, .g = 100, .b = 100, .a = 255 } }) | |
| set_text_align(TextAlign.Left) |
| (module | |
| (type (;0;) (func (param i32))) | |
| (type (;1;) (func (param i32 i32))) | |
| (type (;2;) (func)) | |
| (type (;3;) (func (param i32) (result i32))) | |
| (import "env" "register" (func $register (type 0))) | |
| (func $std.builtin.default_panic (type 1) (param i32 i32) | |
| (local i32 i32 i32) | |
| global.get 0 | |
| local.set 2 |
| // 2000 lines of generated zig... | |
| const struct_unnamed_36 = extern struct {}; | |
| pub const wasmer_instance_t = struct_unnamed_36; | |
| // 2000 more lines of generated zig... |
| scores = [(0.4, "a"), (0.5, "b"), (0.1, "c")] | |
| # Calculate the sum of all scores. | |
| # | |
| # Will probably be 1 since the bots are scored with a percentage, | |
| # but just in case... | |
| denominator = 0 | |
| for score in scores: | |
| denominator += score[0] |
| nix-shell -p cmake llvmPackages_9.clang-unwrapped llvmPackages_9.llvm clang_9 libxml2 zlib pkgconfig --run fish |
display: flex;
A short cheatsheet for flexbox. Assembled from w3schools and [MDN][2].