Skip to content

Instantly share code, notes, and snippets.

View artemnikitin's full-sized avatar
🍵

Artem Nikitin artemnikitin

🍵
View GitHub Profile
@artemnikitin
artemnikitin / keybase.md
Last active June 27, 2022 08:14
Keybase proof

Keybase proof

I hereby claim:

  • I am artemnikitin on github.
  • I am artemnikitin (https://keybase.io/artemnikitin) on keybase.
  • I have a public key ASDfjxaR2b4qyT5G_1Cu0oGodoK9tnk8JSvv0nsVLvEDJgo

To claim this, I am signing this object:

@artemnikitin
artemnikitin / example.go
Created October 30, 2019 18:02
Cleanup test output
// Replacement for https://github.com/elastic/cloud-on-k8s/blob/master/test/e2e/cmd/run/run.go#L346-L365
var f *os.File
if h.logToFile {
f, err = os.Create(testsLogFile)
if err != nil {
log.Error(err, "Can't create file for test output")
return
}
defer f.Close()

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@artemnikitin
artemnikitin / go
Created September 11, 2018 09:36
Test example
func TestReaderBlaBlaBla1(t *testing.T) {
descriptor := &TestMemoryDescriptor{Array: bytes} //input
result := Read(descriptor, 1, 1, false)
assert.Equal(t, 5, result,
"Result expected: %v, actual: %v, for test data: %v", v.expected, result, v)
}
func TestReaderBlaBlaBla2(t *testing.T) {
descriptor := &TestMemoryDescriptor{Array: bytes} //input
result := Read(descriptor, 1, 2, false)
@artemnikitin
artemnikitin / enum_proposal.md
Last active July 7, 2018 23:37
Proposal for enum support in Go implementation of Flatdata

First of all, in Go there are no enums. The common way of implementing enum-like functionality is via constants:

const(
	ConstantText = ""
	ConstantInt int64 = 2342423324
)
func sendRequest(url string, file *io.Reader, info os.FileInfo) *http.Response {
client := &http.Client{
Timeout: 10 * time.Minute,
}
request, err := http.NewRequest("PUT", url, *file)
errors.Validate(err, "Failed to create HTTP request")
request.Header.Add("Content-Type", "application/octet-stream")
request.ContentLength = info.Size()
resp, err := client.Do(request)
errors.Validate(err, "Failed to upload file by S3 link")
@artemnikitin
artemnikitin / IntelliJ_IDEA__Perf_Tuning.txt
Created April 16, 2017 11:40 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@artemnikitin
artemnikitin / example.json
Created March 3, 2017 07:44
response with vulnerabilities
{
"result": "OK",
"data": {
"packages": {
"openssl 0.9x-1+deb8u5 amd64": {
"DSA-3287": [
{
"package": "openssl 0.9x-1+deb8u5 amd64",
"providedVersion": "0.9x-1+deb8u5",
"bulletinVersion": "1.0.1e-2+deb7u17",
@artemnikitin
artemnikitin / example.json
Created March 2, 2017 22:00
vulners macos json
{
"os": "MacOS",
"version": "10.12.4",
"package": [
"com.apple.pkg.AppExceptions.14U2177"
]
}
{
"result": "ERROR",
@artemnikitin
artemnikitin / slack-bot.go
Last active August 19, 2016 08:15
Slack bot for repost messages
package main
import (
"flag"
"fmt"
"log"
"os"
"regexp"
"strings"