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
openapi: 3.0.0 | |
info: | |
title: Hackernews API | |
description: An API to interact with Hackernews data. | |
version: 1.0.0 | |
servers: | |
- url: https://hacker-news.firebaseio.com/v0 | |
description: Main API server | |
paths: | |
/topstories.json: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import logging | |
import traceback | |
import json | |
from typing import Callable | |
def json_handler(func: Callable): | |
def wrapper(*args, **kwargs): | |
decorated = json_exception_handler(json_payload_extractor(func)) |
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 find_minimums(iterable, func): | |
"""Returns all items of the iterable with the same minimum value""" | |
minimum = None | |
minimums = [] | |
for item in iterable: | |
if minimum is None or func(item) < minimum: | |
minimum = func(item) | |
minimums = [item] | |
elif func(item) == minimum: | |
minimums.append(item) |
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
[outputlookup_guard(2)] | |
args = name,allowed_changes | |
definition = eventstats count as new_count\ | |
| eval old_count=[| inputlookup $name$ | stats count | return $count]\ | |
| eval max_count=old_count*(1+$allowed_changes$), min_count=old_count/(1+$allowed_changes$)\ | |
| where new_count>min_count and new_count<max_count\ | |
| fields - new_count, old_count, min_count, max_count\ | |
| outputlookup $name$ override_if_empty=false | |
iseval = 0 | |
errormsg = 'name' must be a lookup and 'allowed_changes' must be a number between 0 and 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
#!/usr/bin/env bash | |
# Depedency: requires yq>=4.x and kubectl | |
if [ "$#" -ne 4 ]; then | |
echo "Usage: copy_secret <src_namespace> <src_secret_name> <dest_namespace> <dest_secret_name>" | |
exit 1 | |
fi | |
function copy_secret { | |
local src_ns=$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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: splunk-configurator | |
spec: | |
selector: | |
matchLabels: | |
app.kubernetes.io/name: splunk-configurator | |
replicas: 1 | |
template: |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: splunk | |
spec: | |
selector: | |
matchLabels: | |
app.kubernetes.io/name: splunk | |
replicas: 1 | |
template: |
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
[mapsearch] | |
chunked = true | |
filename = map_search.py | |
python.version = python3 |
NewerOlder