Skip to content

Instantly share code, notes, and snippets.

View language_name_endonym_code.json
[
{
"name": "аҧсуа бызшәа, аҧсшәа",
"english_name": "Abkhazian",
"code": "ab"
},
{
"name": "Afaraf",
"english_name": "Afar",
"code": "aa"
@loganlinn
loganlinn / fc4upd.sh
Created Apr 3, 2021
Example 16-43. Updating FC4 - Advanced Bash-Scripting Guide
View fc4upd.sh
#!/bin/bash
# fc4upd.sh
# Script author: Frank Wang.
# Slight stylistic modifications by ABS Guide author.
# Used in ABS Guide with permission.
# Download Fedora Core 4 update from mirror site using rsync.
# Should also work for newer Fedora Cores -- 5, 6, . . .
View divvy-export
#!/usr/bin/env bash
# @name divvy-export
# @author Logan Linn <mail@loganlinn.com>
# @date 2021-04-20
set -e
_pbtemp=$(mktemp)
>"$_pbtemp" pbpaste
@loganlinn
loganlinn / install_script.sh
Created Feb 23, 2021
DataDog Agent Installer
View install_script.sh
#!/bin/bash
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# Datadog Agent installation script: install and set up the Agent on supported Linux distributions
# using the package manager and Datadog repositories.
set -e
install_script_version=1.3.1
logfile="ddagent-install.log"
View schemer.py
import argparse
import logging
import os
import sys
from inspect import cleandoc
from collections import namedtuple
import clickhouse_driver
assert sys.version_info > (3,)
View olap.patch
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",
View BUILD
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"],
}),
)
View platform.bzl
# 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":
View archives.bzl
_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])
View direnv-stdlib.sh
#!/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".