Skip to content

Instantly share code, notes, and snippets.

diff --git a/olap_api/olap/clickhouse/BUILD b/olap_api/olap/clickhouse/BUILD
new file mode 100644
index 0000000..19c4c71
--- /dev/null
+++ b/olap_api/olap/clickhouse/BUILD
@@ -0,0 +1,14 @@
+load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
+
+kt_jvm_library(
+ name = "clickhouse",
@loganlinn
loganlinn / BUILD
Last active October 12, 2020 20:55
rules_yq
genrule(
name = "yq_binary",
cmd = "cp $< $@",
outs = ["yq"],
srcs = select({
"@bazel_tools//src/conditions:linux_x86_64": ["@yq_linux//file"],
"@bazel_tools//src/conditions:darwin": ["@yq_darwin//file"],
"@bazel_tools//src/conditions:windows": ["@yq_windows//file"],
}),
)
# Implementation taken from: https://github.com/bazelbuild/rules_go/blob/312a801084712314ea7da6f1c226306af58eb097/go/private/sdk.bzl#L182-L218
def detect_host_platform(ctx):
"""Returns string identifier for host platform."""
if ctx.os.name == "linux":
host = "linux_amd64"
res = ctx.execute(["uname", "-p"])
if res.return_code == 0:
uname = res.stdout.strip()
if uname == "s390x":
_ARCHIVE_EXTENSIONS = ["zip", "jar", "war", "tar", "tar.gz", "tgz", "tar.xz", "tar.bz2"]
def smells_like_archive(s):
return any([s.endswith(archive_ext) for archive_ext in _ARCHIVE_EXTENSIONS])
#!/usr/bin/env bash
#
# These are the commands available in an .envrc context
#
# ShellCheck exceptions:
#
# SC1090: Can't follow non-constant source. Use a directive to specify location.
# SC1091: Not following: (file missing)
# SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".
# SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo".
@loganlinn
loganlinn / open_url.sh
Last active September 29, 2020 20:49
bash script for opening URLs cross-platform (open, xdg-open, wslview)
#!/bin/bash
main() {
local url=${1}
case "$OSTYPE" in
darwin*)
open "${url}" ;;
mysys*)
exe /c start "${url/&/^&}" ;;
@loganlinn
loganlinn / config.yml
Last active June 30, 2022 19:25
github cli config
aliases:
pv: pr view --web
land: pr merge --squash --delete-branch
config-export: '!cat ~/.config/gh/config.yml | jq --raw-input --slurp -r "{files: {\"config.yml\": {content: .}}}" | gh api -X PATCH /gists/ba5517759522578585830221e88c1658 --input - | jq .html_url | xargs open'
clone: |-
!mkdir -p "${CODE}/$1" && gh repo clone "$1" "${CODE}/$1"
v: repo view --web
@loganlinn
loganlinn / delete-login-item.sh-session
Last active August 29, 2020 22:06
Removing macOS login item for Steam from the command-line using `osascript`
$ osascript -e 'tell application "System Events" to get the name of every login item'
Steam, Google Drive File Stream
$ osascript -e 'tell application "System Events" to delete login item "Steam"'
$ osascript -e 'tell application "System Events" to get the name of every login item'
Google Drive File Stream
@loganlinn
loganlinn / theme.json
Last active August 4, 2020 00:17
Structurizr theme for Apache Samza
{
"name": "Apache Samza",
"description": "",
"elements": [
{
"tag": "Apache Samza - Job",
"stroke": "#693cc5",
"color": "#693cc5",
"icon": "http://samza.apache.org/img/samza-just-logo-transparent.png"
}
#!/bin/bash
bazel query 'kind(".*binary rule", //...)' --output=label