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 ( | |
"bufio" | |
"database/sql" | |
"flag" | |
"fmt" | |
"path" | |
"strconv" | |
"strings" |
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
map $msec $millis { ~(.*)\.(.*) $2; } | |
map $time_iso8601 $time_iso8601_m { ~(.*)\+(.*) $1.$millis+$2; } | |
log_format json_combined escape=json | |
'{' | |
'"_ms": "$millis",' # Has to be here in order for timestamp to work. Wat | |
'"timestamp": "$time_iso8601_m",' | |
'"service": "sp-frontend",' | |
'"remote_addr":"$remote_addr",' | |
'"message":"[$status] $request_method $request_uri",' |
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 client | |
import ( | |
"bytes" | |
"context" | |
"crypto/tls" | |
"encoding/json" | |
"fmt" | |
"github.com/pkg/errors" | |
"io" |
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
import React, {useCallback, useMemo} from 'react'; | |
export const useCheckbox = (allValues: string[], selected: string[], onChange: (newSelection: string[]) => void) => { | |
const selectedStatesObj = useMemo(() => (selected || []).reduce((p, c) => ({ | |
...p, | |
[c]: true | |
}), {} as {[id: string]: boolean}), [selected]); | |
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 tutils | |
import ( | |
"path" | |
"reflect" | |
"runtime" | |
"testing" | |
) | |
func AssertNotNil(t *testing.T, obj 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
Imports Microsoft.Owin | |
Imports Microsoft.Owin.Security.OpenIdConnect | |
Imports Owin | |
Imports Microsoft.Owin.Security | |
Imports Microsoft.Owin.Security.Notifications | |
Imports Microsoft.Owin.Security.Cookies | |
Imports Microsoft.IdentityModel.Protocols.OpenIdConnect | |
Imports Microsoft.IdentityModel.Tokens | |
Imports System.Threading.Tasks |
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
namespace Foobar | |
{ | |
public class RequestLogMiddleware | |
{ | |
public class LogData { | |
public IPAddress RemoteAddr {get;set;} | |
public string User {get;set;} | |
public int ResponseStatus {get;set;} |
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
#!/bin/bash | |
WORK_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
set -ueo pipefail | |
checkTimeout=6 | |
SEND_ERROR_MAIL=1 | |
cd "$WORK_DIR" | |
function send_to_slack { | |
local status=$1 |
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
FROM golang:1.9-alpine | |
# vi: ft=dockerfile | |
RUN apk update && apk add curl \ | |
git \ | |
protobuf \ | |
bash \ | |
make \ | |
openssh-client && \ | |
rm -rf /var/cache/apk/* |