Skip to content

Instantly share code, notes, and snippets.

View App.js
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>
View node_semver.go
//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"
View eqlComptime.zig
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;
},
View query_string_map.zig
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,
View headers.h
// 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
View config.h
#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.
@Jarred-Sumner
Jarred-Sumner / symbols.c
Last active Jul 13, 2021
JavaScriptCore.framework symbols list. Generated via https://github.com/macmade/dyld_cache_extract on the dyld cache, choosing JavaScriptCore, then running https://github.com/DerekSelander/dsdump on the output
View symbols.c
0x7fff3659cf30 __ZN3WTF15initializeDatesEv
0x7fff3659d1a0 __ZN3JSC30FixedVMPoolExecutableAllocatorC2Ev
0x7fff3659d400 __ZN3WTF12RedBlackTreeINS_13MetaAllocator13FreeSpaceNodeEmE6insertEPS2_
0x7fff3659d810 __ZN3JSC5LLInt10initializeEv
0x7fff3659db00 __ZN3WTF10StringImplD2Ev
0x7fff3659e0c0 __ZN3WTF7CString18copyBufferIfNeededEv
0x7fff3659e4b0 __ZN3WTFL19wtfThreadEntryPointEPv
0x7fff3659e650 __ZN3WTF10StringImpl15stripWhiteSpaceEv
0x7fff3659eaa0 __ZN3WTF10StringImpl6toUIntEPb
0x7fff3659f9b0 __ZN3WTF17double_conversion6StrtodENS0_15BufferReferenceIKcEEi
@Jarred-Sumner
Jarred-Sumner / gist:e4ae7b4c988426f8f4d57890934882ca
Created Jul 13, 2021
JavaScriptCore.framework symbols list. Generated via https://github.com/macmade/dyld_cache_extract on the dyld cache, choosing JavaScriptCore, then running https://github.com/DerekSelander/dsdump on the output
View gist:e4ae7b4c988426f8f4d57890934882ca
This file has been truncated, but you can view the full file.
0x7fff3659cf30 __ZN3WTF15initializeDatesEv
0x7fff3659d1a0 __ZN3JSC30FixedVMPoolExecutableAllocatorC2Ev
0x7fff3659d400 __ZN3WTF12RedBlackTreeINS_13MetaAllocator13FreeSpaceNodeEmE6insertEPS2_
0x7fff3659d810 __ZN3JSC5LLInt10initializeEv
0x7fff3659db00 __ZN3WTF10StringImplD2Ev
0x7fff3659e0c0 __ZN3WTF7CString18copyBufferIfNeededEv
0x7fff3659e4b0 __ZN3WTFL19wtfThreadEntryPointEPv
0x7fff3659e650 __ZN3WTF10StringImpl15stripWhiteSpaceEv
0x7fff3659eaa0 __ZN3WTF10StringImpl6toUIntEPb
View show-ulimit.zig
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| {
View color-looper.zig
const std = @import("std");
// usage:
// ./file-path:0 10
// 1 2 3
// 1. file path
// 2. Byte offset in file
// 3. ms update interval
pub fn main() anyerror!void {