View asm.s
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.intel_syntax noprefix | |
.file "test" | |
.globl _start | |
.type _start,@function | |
_start: | |
push ebp | |
push ebx | |
push edi | |
push esi |
View dbg.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const builtin = @import("builtin"); | |
pub fn main() !void { | |
try dbg("{d}", 24); | |
} | |
fn dbg(comptime fmt: []const u8, x: anytype) !void { | |
comptime std.debug.assert(builtin.mode == .Debug); |
View stackoverflow.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
extern fn sigaltstack(ss: *const stack_t, oss: *stack_t) c_int; | |
const stack_t = extern struct { | |
sp: ?*anyopaque, | |
flags: c_int, | |
size: usize, | |
}; |
View user_pass_ssh.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"golang.org/x/crypto/ssh" | |
) | |
func main() { |
View _more_readers.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub usingnamespace @import("counting.zig"); |
View PanicAllocator.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const Allocator = std.mem.Allocator; | |
pub const panic_allocator = Allocator{ | |
.ptr = undefined, | |
.vtable = &panic_allocator_vtable, | |
}; | |
const panic_allocator_vtable = Allocator.VTable{ | |
.alloc = panicAlloc, |
View main.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const c = @cImport({ | |
@cInclude("X11/Xlib.h"); | |
@cInclude("X11/Xutil.h"); | |
@cInclude("X11/keysymdef.h"); | |
@cInclude("GL/gl.h"); | |
@cInclude("GL/glx.h"); | |
}); |
View mime.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const string = []const u8; | |
const types = std.ComptimeStringMap(string, .{ | |
.{ ".aac", "audio/aac" }, | |
.{ ".abw", "application/x-abiword" }, | |
.{ ".arc", "application/x-freearc" }, | |
.{ ".avi", "video/x-msvideo" }, | |
.{ ".azw", "application/vnd.amazon.ebook" }, | |
.{ ".bin", "application/octet-stream" }, |
View signal.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const __sighandler_t = ?fn (c_int) callconv(.C) void; | |
extern fn signal(__sig: c_int, __handler: __sighandler_t) __sighandler_t; | |
pub fn listenFor(sig: c_int, comptime f: fn () void) void { | |
_ = signal(sig, Handler(f).handle); | |
} | |
fn Handler(comptime f: fn () void) type { |
View docker.zig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const extras = @import("extras"); | |
pub fn amInside() !bool { | |
return try extras.doesFileExist(null, "/.dockerenv"); | |
} |
NewerOlder