This file contains hidden or 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
::: {mbWgjAZ}{mbWgjAZxSNaAW_l9X8fNlg}{p2C53LZTT4qTYWW1XQIunw}{x.x.x.x}{x.x.x.x:9300}{zone=us-west-2a, distributed_snapshot_deletion_enabled=true} | |
Hot threads at 2023-09-29T20:45:22.684, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: | |
50.5% (252.5ms out of 500ms) cpu usage by thread 'elasticsearch[mbWgjAZ][[2023092902][9]: Lucene Merge Thread #444]' | |
2/10 snapshots sharing following 14 elements | |
app//org.apache.lucene.index.MultiTermsEnum.postings(MultiTermsEnum.java:361) | |
app//org.apache.lucene.index.MappedMultiFields$MappedMultiTermsEnum.postings(MappedMultiFields.java:127) | |
app//org.apache.lucene.codecs.PushPostingsWriterBase.writeTerm(PushPostingsWriterBase.java:122) | |
app//org.apache.lucene.codecs.blocktree.BlockTreeTermsWriter$TermsWriter.write(BlockTreeTermsWriter.java:864) | |
app//org.apache.lucene.codecs.blocktree.BlockTreeTermsWriter.write(BlockTreeTermsWriter.java:343) |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -euo pipefail | |
echo "-- installing homebrew" | |
if ! type "brew" > /dev/null; then | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
fi | |
if [[ ! -x /opt/homebrew/bin/zsh ]]; then |
This file contains hidden or 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
package gcd | |
// GCD binary algorithm, derived from | |
// https://en.wikipedia.org/wiki/Binary_GCD_algorithm#Iterative_version_in_C | |
func GCD(u, v uint64) uint64 { | |
var shift uint | |
/* GCD(0,v) == v; GCD(u,0) == u, GCD(0,0) == 0 */ | |
if u == 0 { | |
return v |
This file contains hidden or 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
package lock_test | |
import ( | |
"fmt" | |
"sync" | |
"testing" | |
"time" | |
) | |
type rlocker interface { |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
BINDIR=/opt/kafka/kafka_2.11-0.10.0.1/bin/ | |
TOPICS=${@:1} | |
if [[ "$TOPICS" == "" ]]; then | |
echo "Usage: $0 topic1 topic2 ..." | |
exit 1 | |
fi |
This file contains hidden or 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
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"net/http" | |
) | |
func main() { | |
log.SetFlags(log.LstdFlags | log.Lmicroseconds) |
This file contains hidden or 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
# Log into a Docker Compose service container, e.g. | |
# | |
# dclogin go_ismtpd | |
# dclogin go_i # also works | |
# | |
function dclogin | |
{ | |
container=$(docker-compose ps | grep _$1 | head -1 | awk '{print $1}') | |
if [ -z "$container" ]; then | |
echo "no container found matching $1" > /dev/stderr |
This file contains hidden or 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
package map_test | |
import ( | |
"testing" | |
) | |
func BenchmarkMapStringKey(b *testing.B) { | |
var m map[string]string = make(map[string]string) | |
var k string = "key" | |
for i := 0; i < b.N; i++ { |
This file contains hidden or 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 Main (..) where | |
import Effects | |
import Html | |
import Html.Attributes exposing (style) | |
import Html.Events as Events | |
import Http | |
import Json.Decode exposing ((:=)) | |
import StartApp | |
import Task |
This file contains hidden or 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
package main | |
import ( | |
"log" | |
"github.com/nlopes/slack" | |
) | |
const ( | |
apiToken = "API TOKEN" |
NewerOlder