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
type t interface { | |
Errorf(string, ...interface{}) | |
} | |
func testStringer(test t, str stringer, expected ...string) { | |
var value = str.String() | |
if value == "" { | |
test.Errorf("%T.String() must not return an empty string", str) | |
return |
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 log | |
import ( | |
"context" | |
) | |
type ctxKeyType struct{} | |
var ctxKey ctxKeyType |
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
// MIT License | |
// | |
// Copyright (c) 2020 Petrukhin Pavel | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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.14 as builder | |
RUN git clone \ | |
--depth 1 \ | |
--single-branch \ | |
--branch=dev.go2go \ | |
--progress \ | |
https://go.googlesource.com/go /go2 | |
ENV CGO_ENABLED=0 |
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
run: | |
# concurrency: 2 # available CPU number | |
timeout: 5m # timeout for analysis | |
issues-exit-code: 1 # exit code when issue was found | |
build-tags: [] # list of build tags | |
tests: true # include tests | |
skip-dirs: [] # dirs to skip | |
skip-dirs-use-default: true # skip vendor, third_party, test_data | |
modules-download-mode: readonly # readonly|release|vendor |
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 log | |
import ( | |
"io" | |
"time" | |
"go.uber.org/zap" | |
"go.uber.org/zap/zapcore" | |
) |
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
// ==UserScript== | |
// @name Export merge requests to a text file | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://git.kodix.ru/vgr/garage/merge_requests | |
// @grant none | |
// ==/UserScript== |
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
var query = "//*[contains(concat(' ', normalize-space(@class),' '), 'merge-request-title-text ')]/a"; | |
var formatter = function(elem, i) { | |
return "review " + elem.innerText + ". Link: " + elem.href | |
} | |
var tasks = $x(query) | |
.map(formatter) | |
.join('\n'); | |
console.log(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
import ( | |
"errors" | |
"strings" | |
"testing" | |
"github.com/google/go-cmp/cmp" | |
) | |
func TestTest(test *testing.T) { |
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
%matplotlib inline | |
import numpy as np | |
import scipy.constants as scc | |
import scipy.integrate as sci | |
from mpl_toolkits.mplot3d import Axes3D | |
from matplotlib import pyplot as plt | |
import scipy.optimize as sco |