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
package bench_append_test | |
import ( | |
"testing" | |
) | |
const N = 10 | |
func BenchmarkBareAppend(bench *testing.B) { | |
var values = make([]int, N) |
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
macro_rules! update { | |
(&$data:ident, $( $key:ident = $x:expr ),*) => ( | |
{ | |
fn clone<T>(data: &T) -> T | |
where T: Clone { | |
data.clone() | |
} | |
let cp = clone(&$data); | |
update!(cp, $( $key = $x ),*) | |
} |
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
func NewHTTPClient() *http.Client { | |
return &http.Client{ | |
Timeout: 10 * time.Second, | |
Transport: &http.Transport{ | |
DialContext: (&net.Dialer{ | |
Timeout: 5 * time.Second, | |
}).DialContext, | |
TLSHandshakeTimeout: 5 * time.Second, | |
}, | |
} |
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
%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 |
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 ( | |
"errors" | |
"strings" | |
"testing" | |
"github.com/google/go-cmp/cmp" | |
) | |
func TestTest(test *testing.T) { |
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
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 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 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 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 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 |