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
new_http_archive( | |
name = "docker_ubuntu", | |
build_file_content = """ | |
docker_build( | |
name = "trusty", | |
tars = ["trusty/ubuntu-trusty-core-cloudimg-amd64-root.tar.gz"], | |
visibility = ["//visibility:public"] | |
) | |
""", | |
sha256 = "de31e6fcb843068965de5945c11a6f86399be5e4208c7299fb7311634fb41943", |
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
def _get_docker_env(repository_ctx): | |
"""Get whitelisted environment variables from the local system.""" | |
env = {} | |
env_whitelist = [ | |
"HTTP_PROXY", "http_proxy", | |
"HTTPS_PROXY", "https_proxy", | |
"NO_PROXY", "no_proxy", | |
] | |
for k, v in repository_ctx.os.environ.items(): | |
if k in env_whitelist or k.startswith("DOCKER"): |
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
git_repository( | |
name = "io_bazel_rules_go", | |
commit = "878185a8d66cb4a3fb93602d8e8bc2f50cd69616", | |
remote = "https://github.com/bazelbuild/rules_go", | |
) | |
load( | |
"@io_bazel_rules_go//go:def.bzl", | |
"go_repositories", | |
"go_repository", |
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
#!/bin/bash | |
# This script will be run bazel when building process starts to | |
# generate key-value information that represents the status of the | |
# workspace. The output should be like | |
# | |
# KEY1 VALUE1 | |
# KEY2 VALUE2 | |
# | |
# If the script exits with non-zero code, it's considered as a failure |
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
"""gen_build_data: generate build_data from various templates. | |
This does something very simple: concatenates bazel's stable-status and | |
volatile-status linkstamp data with an optional header and footer. | |
""" | |
def _gen_build_data_impl(ctx): | |
cmd = ["cat"] | |
inputs = [ | |
ctx.version_file, # volatile-status.txt |
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
# Generated by running `configure --enable-unicode=ucs2` on MacOS 10.11.6 | |
DEFINES_DARWIN = [ | |
"Py_PYCONFIG_H", | |
"DOUBLE_IS_LITTLE_ENDIAN_IEEE754=1", | |
"ENABLE_IPV6=1", | |
"HAVE_ACOSH=1", | |
"HAVE_ADDRINFO=1", | |
"HAVE_ALARM=1", | |
"HAVE_ALLOCA_H=1", | |
"HAVE_ASINH=1", |
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
{-# LANGUAGE TupleSections #-} | |
module P1b where -- http://adventofcode.com/2016/day/1 | |
import Data.String.Utils (split, strip) | |
data Direction = North | East | South | West | |
runbunny :: Integral a => Read a => | |
[(a, a)] -- coordinates already visited |
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
# What's the difference in meaning between these two prometheus rules? | |
query_version_a = | |
( | |
sum | |
by (source) | |
( | |
( | |
( | |
rate(cpu_user_seconds_total[3m]) |
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
module Parse where | |
import Control.Monad (void) | |
import qualified Data.Char | |
import Text.Megaparsec | |
import Text.Megaparsec.String | |
import qualified Text.Megaparsec.Lexer as L | |
data JsonnetNumber = JInt Integer | |
| JFloat Double |
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
{ config, lib, ... }: | |
{ | |
nixpkgs.config.packageOverrides = super: let self = super.pkgs; in | |
{ | |
myHaskellEnv = self.haskellPackages.ghcWithHoogle | |
(haskellPackages: with HaskellPackages; [ | |
# libraries | |
arrows async cgi criterion | |
# tools |