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 / 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 / download_anonymous_icons_from_drive.rb
Last active December 13, 2023 03:30
Downloads all of the icons of anonymous animals from Google Drive
#!/usr/bin/env ruby
icon_list = "alligator, anteater, armadillo, auroch, axolotl, badger, bat, beaver, buffalo, camel, chameleon, cheetah, chipmunk, chinchilla, chupacabra, cormorant, coyote, crow, dingo, dinosaur, dolphin, duck, dragon, elephant, ferret, fox, frog, giraffe, gopher, grizzly, hedgehog, hippo, hyena, jackal, ibex, ifrit, iguana, koala, kraken, lemur, leopard, liger, llama, manatee, mink, monkey, narwhal, nyan cat, orangutan, otter, panda, penguin, platypus, python, pumpkin, quagga, rabbit, raccoon, rhino, sheep, shrew, skunk, slow loris, squirrel, turtle, walrus, wolf, wolverine, wombat"
for icon in icon_list.split ', ' do
element = icon.sub ' ', ''
`curl https://ssl.gstatic.com/docs/common/profile/#{element}_lg.png -o icons/#{element}.png`
end
@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 / motd.sh
Created January 6, 2017 05:54
Raspberry Pi motd
#!/bin/bash
clear
function color (){
echo "\e[$1m$2\e[0m"
}
function extend (){
local str="$1"
@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">