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 flatend | |
import ( | |
"encoding/json" | |
"strconv" | |
"testing" | |
"unsafe" | |
) | |
var _ json.Marshaler = (*SafePayload)(nil) |
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
(flatlang.Program) { | |
Stmts: ([]flatlang.Stmt) (len=10 cap=16) { | |
(flatlang.Stmt) { | |
Type: (flatlang.StmtType) Assign, | |
Name: (string) (len=2) "db", | |
Exprs: ([]flatlang.Expr) (len=1 cap=1) { | |
(flatlang.Expr) { | |
Nodes: ([]flatlang.Node) (len=1 cap=1) { | |
(flatlang.StringNode) { | |
Val: (string) (len=17) "sqlite://:memory:" |
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
func unescape(s string) (string, error) { | |
if !strings.ContainsRune(s, '\\') && utf8.ValidString(s) { | |
return s, nil | |
} | |
tmp := make([]byte, utf8.UTFMax) | |
buf := make([]byte, 0, 3*len(s)/2) | |
for len(s) > 0 { | |
c, mb, t, err := strconv.UnquoteChar(s, '"') | |
if err != nil { | |
return "", err |
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 layout | |
import "github.com/lithdew/casso" | |
type Layout struct { | |
solver *casso.Solver | |
tags []casso.Symbol | |
err error | |
} |
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 net = @import("./zig-network/network.zig"); | |
const PROTOCOL = net.Protocol.tcp; | |
pub fn main() !void { | |
var buf: [16384]u8 = undefined; | |
var fba = std.heap.FixedBufferAllocator.init(&buf); | |
try net.init(); |
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 ( | |
"encoding/hex" | |
"fmt" | |
"github.com/lithdew/monte" | |
"net" | |
) | |
func main() { |
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 print = std.debug.print; | |
const File = std.fs.File; | |
const BufferedWriter = std.io.BufferedWriter; | |
const Address = std.net.Address; | |
const Server = std.net.StreamServer; | |
const Connection = std.net.StreamServer.Connection; |
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
var frame: anyframe = undefined; | |
pub fn main() !void { | |
print("Before\n", .{}); | |
const handler = struct { | |
fn impl(sig: i32, info: *std.os.siginfo_t, ucontext: ?*c_void) callconv(.C) void { | |
resume frame; | |
} | |
}; |
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"); | |
pub const io_mode = .evented; | |
var main_frame: ?*std.event.Loop.NextTickNode = undefined; | |
pub fn loop(server: *std.net.StreamServer) !void { | |
while (true) { | |
var conn = server.accept() catch |err| { | |
std.debug.print("Got loop error: {}\n", .{err}); |
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 print = std.debug.print; | |
const assert = std.debug.assert; | |
pub const signalfd_siginfo = extern struct { | |
signo: u32, | |
errno: i32, | |
code: i32, | |
pid: u32, |
OlderNewer