Skip to content

Instantly share code, notes, and snippets.

View benley's full-sized avatar
🐈

Benjamin Staffin benley

🐈
View GitHub Profile
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",
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"):
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",
@benley
benley / linkerd.conf.yml
Last active November 8, 2016 10:27
example: linkerd config for aurora job backends
# Example linkerd.conf for aurora jobs
admin: { port: '31218' }
namers:
- kind: io.l5d.serversets
prefix: /zk/dal09
zkAddrs:
- { host: zk1.dal09.prod.example.com, port: '2181'}
- { host: zk2.dal09.prod.example.com, port: '2181'}
{ lib, bundlerEnv, stdenv }:
let
name = "hiera-eyaml-2.1.0";
env = bundlerEnv {
inherit name;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
let
pkgs = import <nixpkgs> {};
default = pkgs.callPackage ./default.nix { };
in
pkgs.stdenv.mkDerivation {
name = "fake";
buildInputs = [
default
pkgs.extradep1
let
pkgs = import <nixpkgs> {};
default = pkgs.callPackage (import ./default.nix);
in
pkgs.stdenv.mkDerivation {
name = "fake";
buildInputs = [
default
pkgs.extradep1
let pkgs = import <nixpkgs> {}; in
pkgs.lib.overrideDerivation pkgs.apacheKafka
(xx: {
buildInputs = xx.buildInputs ++ [ pkgs.extradep1 pkgs.extradep2 ];
})
// Render any jsonnet value (except functions) to TOML format.
local
inlineTable(body) =
"{" +
std.join(", ", ["%s = %s" % [escapeKeyToml(k), renderBody(body[k])] for k in std.objectFields(body)]) +
"}",
renderArray(body) =
local
@benley
benley / shittylife.hs
Last active May 8, 2024 21:58
conway's game of 💩
-- conway's game of 💩
-- shittily written by benley
module Main where
import Control.Concurrent
import Data.Array.Unboxed
import System.Environment
data Cell = Live | Dead deriving Eq