Skip to content

Instantly share code, notes, and snippets.

View rockwotj's full-sized avatar
:shipit:

Tyler Rockwood rockwotj

:shipit:
View GitHub Profile
@rockwotj
rockwotj / clang-build.sh
Last active August 9, 2024 13:20
Building Clang From source
cmake -G Ninja -DLLVM_TARGETS_TO_BUILD=X86 \
-DCMAKE_INSTALL_PREFIX=$PWD/install \
-B $PWD/build \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_UTILS=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DLLVM_ENABLE_ZLIB=OFF \
-DLLVM_ENABLE_ZSTD=OFF \
@rockwotj
rockwotj / BUILD
Created April 25, 2024 01:09 — forked from bsilver8192/BUILD
Basics of generating a compile_commands.json file with Bazel
py_binary(
name = 'generate_compile_command',
srcs = [
'generate_compile_command.py',
],
deps = [
'//third_party/bazel:extra_actions_proto_py',
],
)
@rockwotj
rockwotj / NativeJvmElasticSearchTransport.kt
Created October 25, 2022 19:35
A Native JVM transport for elasticsearch using the builtin JDK HttpClient instead of apache
private class NativeJvmTransport(private val config: SearchClient.Config) : ElasticsearchTransport {
private val options = Options(
headers = ImmutableMultimap.builder<String, String>().apply {
val mimeType = Version.VERSION?.let { version -> "application/vnd.elasticsearch+json; compatible-with=${version.major()}" } ?: "application/json"
put("Content-Type", mimeType)
put("Accept", mimeType)
config.apiKey?.let { put("Authorization", "ApiKey $it") }
}.build()
)
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
#root {
display:flex;
flex-direction: column-reverse;
overflow-y: scroll;
height: 300px;
@rockwotj
rockwotj / BUILD.bazel
Created June 22, 2022 03:44
BUILD.bazel for Mimalloc to use in cc_binary(malloc = ...)
cc_library(
name = "mimalloc",
srcs = ["src/static.c"],
textual_hdrs = glob(["src/*.c", "src/*.h"], exclude = ["src/static.c"]),
hdrs = glob(["include/*.h"]),
includes = ["include"],
copts = ["-DMI_MALLOC_OVERRIDE"],
visibility = ["//visibility:public"],
)
@rockwotj
rockwotj / Contents.json
Created June 18, 2022 01:53
iphone svg asset json file
{
"images" : [
{
"filename" : "test.svg",
"idiom" : "iphone"
}
],
"info" : {
"author" : "xcode",
"version" : 1
@rockwotj
rockwotj / Foo.h
Last active April 3, 2021 03:01
Generated ObjC Swift Interface
SWIFT_CLASS("_TtC3Foo9TestClass")
@interface TestClass : NSObject
- (void)fooWithLabel:(NSString * _Nonnull)arg;
- (void)foo1:(NSString * _Nonnull)arg;
- (void)barWithLabel:(NSString * _Nonnull)arg other:(NSInteger)ar;
- (void)bar1:(NSString * _Nonnull)arg other:(NSDictionary<NSString *, id> * _Nonnull)ar;
- (void)quxWithLabel:(NSString * _Nonnull)arg :(NSInteger)ar;
- (void)qux1:(NSString * _Nonnull)arg :(NSArray * _Nonnull)ar;
- (void)thudWithArg:(int64_t)arg ar:(double)ar;
- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
@rockwotj
rockwotj / .SC2Hotkeys
Last active September 27, 2019 02:22
[Settings]
Grid=1
Suffix=_GLS
[Hotkeys]
PTT=
AlertRecall=
ArmySelect=Grave
IdleWorker=Shift+Grave
TargetChoose=LeftMouseButton,Z
data:text/html, <html contenteditable style="font-family: courier">
@rockwotj
rockwotj / rtdb_load.py
Last active June 28, 2017 02:30
An example in python on using the Stackdriver Monitoring API to query your Firebase Realtime Database's average load over the past day
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,