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
// | |
// YeetJSIUTils.h | |
// yeet | |
// | |
// Created by Jarred WSumner on 1/30/20. | |
// Copyright © 2020 Facebook. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <jsi/jsi.h> |
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
// Comcast Cable Communications, LLC Proprietary. Copyright 2014. | |
// Intended use is to display browser notifications for critical and time sensitive events. | |
var _ComcastAlert = (function(){ | |
return { | |
SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do' | |
, dragObj: {zIndex: 999999} | |
, browser: null | |
, comcastCheck: 1 | |
, comcastTimer: null | |
, xmlhttp: null |
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"); | |
// 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 { |
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 |
NewerOlder