Skip to content

Instantly share code, notes, and snippets.

View obalunenko's full-sized avatar
:octocat:
Clear is better than clever

Oleg Balunenko obalunenko

:octocat:
Clear is better than clever
View GitHub Profile
@obalunenko
obalunenko / pprof.md
Created November 14, 2023 13:06 — forked from slok/pprof.md
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
@obalunenko
obalunenko / golang_templates_cheatsheet.md
Created May 4, 2022 07:57
Golang Templates Cheatsheet

Golang Templates Cheatsheet

Posted 14 Sep 2017

(saved from curtisvermeeren.github.io)

The Go standard library provides a set of packages to generate output. The text/template package implements templates for generating text output, while the html/template package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.


@obalunenko
obalunenko / install-protoc.sh
Created November 24, 2021 20:06
Install protoc
#!/bin/sh
set -eu
SCRIPT_NAME="$(basename "$0")"
echo "${SCRIPT_NAME} is running... "
PROTOC_VERSION=3.19.1
PROTOC_OS=""
@obalunenko
obalunenko / default.json
Created June 15, 2021 15:38
Iterm profile
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.81066548824310303,
"Red Component" : 0.43880558013916016,
"Blue Component" : 0.99898606538772583
},
@obalunenko
obalunenko / git-diff-files-master.sh
Created May 14, 2021 12:26
Get list of changed files against master bruch
#!/usr/bin/env bash
set -Eeuo pipefail
function cleanup() {
trap - SIGINT SIGTERM ERR EXIT
}
trap cleanup SIGINT SIGTERM ERR EXIT

Keybase proof

I hereby claim:

  • I am obalunenko on github.
  • I am obalunenko (https://keybase.io/obalunenko) on keybase.
  • I have a public key ASBT3A5w3hYpe-Htc82Bp4xV74cZaNOQsGZ5jtWPAklCRQo

To claim this, I am signing this object:

@obalunenko
obalunenko / main.go
Last active November 30, 2021 11:51
algoritms tasks solving
package main
import (
"fmt"
"reflect"
"sort"
)
func main() {
@obalunenko
obalunenko / fix.sh
Created November 2, 2018 13:40
odd xcode CommandLineTools warnings fix
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework /Library/Frameworks/
sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework /Library/Frameworks/
@obalunenko
obalunenko / publickey-git-error.markdown
Created September 24, 2018 11:59 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@obalunenko
obalunenko / countlines.sh
Created September 20, 2018 23:05
Count lines of code in git Go repo
#!/bin/sh
git ls-files |grep ".go" | grep -v "vendor"| xargs wc -l