Skip to content

Instantly share code, notes, and snippets.

View eculver's full-sized avatar
🧠
Braining

Evan Culver eculver

🧠
Braining
View GitHub Profile
@eculver
eculver / error.txt
Created April 18, 2024 16:22
mac + pyspark fail
----> 1 spark = pyspark.sql.SparkSession.builder.getOrCreate()
File /private/var/tmp/_bazel_evanculver/07c3e2715b8fccafd72cb9d10f0c890e/execroot/__main__/bazel-out/darwin_arm64-fastbuild/bin/optout/src/main/python/optout_service_repl.runfiles/3rdparty_deps_pyspark/site-packages/pyspark/sql/session.py:477, in SparkSession.Builder.getOrCreate(self)
475 sparkConf.set(key, value)
476 # This SparkContext may be an existing one.
--> 477 sc = SparkContext.getOrCreate(sparkConf)
478 # Do not update `SparkConf` for existing `SparkContext`, as it's shared
479 # by all sessions.
480 session = SparkSession(sc, options=self._options)
@eculver
eculver / regex-utils.go
Last active April 3, 2024 14:47
Find all named match groups and return as a map keyed by the group name
// FindAllGroups returns a map with each match group. The map key corresponds to the match group name.
// A nil return value indicates no matches.
func FindAllGroups(re *regexp.Regexp, s string) map[string]string {
matches := re.FindStringSubmatch(s)
subnames := re.SubexpNames()
if matches == nil || len(matches) != len(subnames) {
return nil
}
matchMap := map[string]string{}
@eculver
eculver / Auto-refresh bookmarklet
Created January 2, 2010 01:02
Auto-refresh bookmarklet
// origin: http://www.google.com/support/forum/p/Chrome/thread?tid=1a37ccbdde5902fd&hl=en
javascript:
timeout=prompt("Set timeout [s]");
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
@eculver
eculver / TestAgentService_Register_MeshGateway.patch
Created May 16, 2023 17:10
Example of updating to api test case with closure/func annotation for post-upgrade assertion
diff --git a/api/agent_test.go b/api/agent_test.go
index ebf7381547..bfe27325c1 100644
--- a/api/agent_test.go
+++ b/api/agent_test.go
@@ -1927,28 +1927,33 @@ func TestAgentService_Register_MeshGateway(t *testing.T) {
agent := c.Agent()
- reg := AgentServiceRegistration{
- Kind: ServiceKindMeshGateway,
// package bunny provides the public API for the eBunny tool.
package bunny
import (
"errors"
"fmt"
"strconv"
"strings"
"github.com/eculver/go-play/pkg/bunny/github"
@eculver
eculver / oss-ent-merge-helpers.sh
Last active November 1, 2022 19:37
Consul OSS→Enterprise Merge Shell Helpers
function ci-for-oss-ent-merge-branch {
local branch
local base
branch="${1:-}"
if [ -z "${branch}" ]; then
echo "branch name required"
echo "usage: ci-for-oss-ent-merge-branch <branch-name>"
return 1
fi
@eculver
eculver / changelog_checker.sh
Created October 3, 2022 17:35
Consul changelog_checker v0.2
#!/bin/bash
# changelog_checker.sh
#
# example:
# ./changelog_checker.sh release/1.11.x main 14828
set -euo pipefail
@eculver
eculver / CHANGELOG.md
Created August 9, 2022 01:45
Consul 1.13.0 Changelog

BREAKING CHANGES:

  • config-entry: Exporting a specific service name across all namespace is invalid.
  • connect: Removes support for Envoy 1.19 [GH-13807]
  • telemetry: config flag telemetry { disable_compat_1.9 = (true|false) } has been removed. Before upgrading you should remove this flag from your config if the flag is being used. [GH-13532]

FEATURES:

  • acl: It is now possible to login and logout using the gRPC API [GH-12935]
  • agent: Added information about build date alongside other version information for Consul. Extended /agent/self endpoint and consul version commands
@eculver
eculver / protocol-fix.txt
Created March 16, 2015 18:54
How to deal with tmux "protocol version mismatch"
$ tmux attach
protocol version mismatch (client 7, server 6)
$ pgrep tmux
3429
$ /proc/3429/exe attach
@eculver
eculver / is-merged.sh
Created August 2, 2012 19:52
Simple shell script to determine if a branch has been fully merged back in to master and develop(ment)
#!/usr/local/bin/zsh
autoload colors
if [[ "$terminfo[colors]" -gt 8 ]]; then
colors
fi
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
eval $COLOR='$fg_no_bold[${(L)COLOR}]'
eval BOLD_$COLOR='$fg_bold[${(L)COLOR}]'
done