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 fn preallocate_file(fd: std.os.fd_t, offset: std.os.off_t, len: std.os.off_t) void { | |
_ = std.os.linux.fallocate(fd, 0, @intCast(i64, offset), len); | |
} | |
pub fn main() anyerror!void { | |
const argv = std.process.argsAlloc(std.heap.c_allocator) catch unreachable; | |
if (argv.len < 3) { | |
std.log.warn("Usage: {s} <length> <file> [--preallocate]\n", .{argv[0]}); |
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
import logo from "./logo.svg"; | |
import "./App.css"; | |
function App() { | |
const ms = Date.now() - parseInt(window.location.search.substring(1), 10); | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<h3>Loaded in {ms}ms.</h3> |
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
//go:generate go-enum -f=$GOFILE --marshal | |
// originally a fork of https://github.com/blang/semver iirc | |
package node_semver | |
import ( | |
"math" | |
"math/bits" | |
"sort" | |
"strconv" | |
"strings" |
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 fn eqlComptime(self: string, comptime alt: anytype) bool { | |
switch (comptime alt.len) { | |
0 => { | |
@compileError("Invalid size passed to eqlComptime"); | |
}, | |
2 => { | |
const check = comptime std.mem.readIntNative(u16, alt[0..alt.len]); | |
return self.len == alt.len and std.mem.readIntNative(u16, self[0..2]) == check; | |
}, |
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 Api = @import("./api/schema.zig").Api; | |
usingnamespace @import("./global.zig"); | |
/// QueryString array-backed hash table that does few allocations and preserves the original order | |
pub const QueryStringMap = struct { | |
allocator: *std.mem.Allocator, | |
slice: string, | |
buffer: []u8, | |
list: Param.List, |
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
// AUTO-GENERATED | |
#pragma once | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#define ZIG_DECL extern | |
#define CPP_DECL extern | |
#pragma mark - JSC::JSObject |
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
#pragma once | |
/* | |
* Copyright (C) 2006-2021 Apple Inc. All rights reserved. | |
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Library General Public | |
* License as published by the Free Software Foundation; either | |
* version 2 of the License, or (at your option) any later version. |
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
0x7fff3659cf30 __ZN3WTF15initializeDatesEv | |
0x7fff3659d1a0 __ZN3JSC30FixedVMPoolExecutableAllocatorC2Ev | |
0x7fff3659d400 __ZN3WTF12RedBlackTreeINS_13MetaAllocator13FreeSpaceNodeEmE6insertEPS2_ | |
0x7fff3659d810 __ZN3JSC5LLInt10initializeEv | |
0x7fff3659db00 __ZN3WTF10StringImplD2Ev | |
0x7fff3659e0c0 __ZN3WTF7CString18copyBufferIfNeededEv | |
0x7fff3659e4b0 __ZN3WTFL19wtfThreadEntryPointEPv | |
0x7fff3659e650 __ZN3WTF10StringImpl15stripWhiteSpaceEv | |
0x7fff3659eaa0 __ZN3WTF10StringImpl6toUIntEPb | |
0x7fff3659f9b0 __ZN3WTF17double_conversion6StrtodENS0_15BufferReferenceIKcEEi |
This file has been truncated, but you can view the full file.
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
0x7fff3659cf30 __ZN3WTF15initializeDatesEv | |
0x7fff3659d1a0 __ZN3JSC30FixedVMPoolExecutableAllocatorC2Ev | |
0x7fff3659d400 __ZN3WTF12RedBlackTreeINS_13MetaAllocator13FreeSpaceNodeEmE6insertEPS2_ | |
0x7fff3659d810 __ZN3JSC5LLInt10initializeEv | |
0x7fff3659db00 __ZN3WTF10StringImplD2Ev | |
0x7fff3659e0c0 __ZN3WTF7CString18copyBufferIfNeededEv | |
0x7fff3659e4b0 __ZN3WTFL19wtfThreadEntryPointEPv | |
0x7fff3659e650 __ZN3WTF10StringImpl15stripWhiteSpaceEv | |
0x7fff3659eaa0 __ZN3WTF10StringImpl6toUIntEPb | |
0x7fff3659f9b0 __ZN3WTF17double_conversion6StrtodENS0_15BufferReferenceIKcEEi |
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 fn main() anyerror!void { | |
var out = std.io.getStdOut(); | |
var writer = out.writer(); | |
var str: [256]u8 = undefined; | |
var len = str.len; | |
var os_version = try std.os.sysctlbynameZ("kern.osproductversion"[0.. :0], &str, &len, null, 0); | |
try writer.print("macOS: {s}\nFile Descriptor Limit\n", .{str[0..len]}); | |
if (std.os.getrlimit(.NOFILE)) |limit| { |
NewerOlder