Skip to content

Instantly share code, notes, and snippets.

View wayneseymour's full-sized avatar
💭
ABC...always be coding :)

Tre' wayneseymour

💭
ABC...always be coding :)
View GitHub Profile
@wayneseymour
wayneseymour / bash_strict_mode.md
Created February 1, 2023 11:13 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@wayneseymour
wayneseymour / archive-migration.sh
Last active July 7, 2022 14:30
Archive Migration Functions
standard_list="url,index-pattern,action,query,alert,graph-workspace,tag,visualization,canvas-element,canvas-workpad,dashboard,search,lens,map,cases,uptime-dynamic-settings,osquery-saved-query,osquery-pack,infrastructure-ui-source,metrics-explorer-view,inventory-view,infrastructure-monitoring-log-view,apm-indices"
orig_archive="x-pack/test/functional/es_archives/logstash/example_pipelines"
new_archive="x-pack/test/functional/fixtures/kbn_archiver/spaces/disabled_features"
test_config="x-pack/test/functional/apps/logstash/config.ts"
_types() {
local archiveJson=$1
if [[ -f "$archiveJson" ]]; then
@wayneseymour
wayneseymour / git-ssh-error-fix.sh
Created March 15, 2022 10:41 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@wayneseymour
wayneseymour / get_his_branch_on_your_local.sh
Created March 30, 2021 20:23
Use spencer's way to debug test failures in ci
# add his remote
git remote add spalger git@github.com:spalger/kibana.git
# verbosely fetch his remote branch info
git fetch spalger -v
# bring down the branch he was working on, to your local
git branch --track pr/95667 spalger/pr/95667
# checkout that branch
git checkout pr/95667
@wayneseymour
wayneseymour / task-monad.js
Last active March 12, 2021 19:41
Task monad with some examples at the bottom
import { pipe } from './utils';
export const Task = (fork) => ({
fork,
map: (f) => Task((rej, res) => fork(rej, pipe(f, res))),
chain: (f) => Task((rej, res) => fork(rej, (x) => f(x).fork(rej, res))),
fold: (f, g) =>
Task((rej, res) =>
fork(
(x) => f(x).fork(rej, res),
data Parser = WebParser | DbParser
class ParseStrategy p where
parse :: p -> String -> String
instance ParseStrategy Parser where
parse WebParser s = "code for parsing web stuff goes here"
parse DbParser s = "code for parsing db stuff goes here"
fromDB = parse DbParser
import { ToolingLog } from '@kbn/dev-utils';
import { SuperTest } from 'supertest';
// @ts-ignore
import * as Either from '../../../../src/dev/code_coverage/ingest_coverage/either';
const id = (x: any = null) => x;
const recurseEither = (max: number) => (x: number) =>
max > x ? Either.right(x) : Either.left(x);
@wayneseymour
wayneseymour / async_foreach.js
Created February 4, 2021 21:55
Asynchronous for reach using recursion.
const id = x => x;
const asyncForEach = async (xs, i) => {
const res = await Promise.resolve(xs[i])
console.log(`\n### const res: \n\t${res}`);
i++
i === xs.length ? id() : asyncForEach(xs, i)
}

Keybase proof

I hereby claim:

  • I am wayneseymour on github.
  • I am lambda_tre (https://keybase.io/lambda_tre) on keybase.
  • I have a public key ASDr8uWRf55DgF4MA2Qa4tOOS99Dw-9Fn-BaQEBF2utc2Ao

To claim this, I am signing this object: