Skip to content

Instantly share code, notes, and snippets.

View r3code's full-sized avatar

Dmitriy S. Sinyavskiy r3code

View GitHub Profile
@StevenACoffman
StevenACoffman / go-error.md
Last active September 14, 2023 11:48
Errors in Go

This is my notes from a few articles:

Some error values are mostly just used for control flow. For example, "Access Denied", or "Authentication Required".

In my opinion, you should only add stack trace to an error which is potentially going to break your program. A logical error like we have seen in the authorization example does not need a track state. But since Wrap method can be used to ammend original error message which is also called as annotating an error, the choice is up to you.

The types of errors that would bubble up to be a 500 Internal Server Error generally require investigation by a developer. In these cases, a stacktrace (and ideally other contextual information) is incredibly valuable.

@r3code
r3code / resume.json
Last active December 4, 2022 18:48
Dmitriy S. Sinyavskiy Resume / CV (created with https://gitconnected.com/r3code/resume)
{
"basics": {
"name": "Dmitriy S. Sinyavskiy",
"label": "Go Developer | Site Reliability Engineer",
"image": "https://avatars0.githubusercontent.com/u/1355056?v=4",
"url": "https://habr.com/ru/users/r3code/",
"summary": "I'm a software developer with more than 17 years of experience. I try to do my best and encourage teammates to do the same. \n\nI prefer to create documented, well organized and tested code. Other developer should have an ability to start working with the code without any need to ask me about it.\n\nMy open-source code here at GitHub: https://github.com/r3code\n\nOther hobbies:\n* teach kids computer science and programming\n* ship-modeling from plastic\n* snowboarding\n\nI like to work with people. I can understand what stakeholder really need and translate the data to the developers language. Before tell, I listen then propose. For me, it is very important to do the work! I use Kanban board to manage task flow and EventStorming methodology to und

So, are you building microservices? Take a look at a few of these symptoms, and decide for yourself:

  • ❌ A change to one microservice often requires changes to other microservices
  • ✅ Deploying one microservice requires other microservices to be deployed at the same time
  • ❓ Your microservices are overly chatty
  • ❌ The same developers work across a large number of microservices
  • ✅ Many of your microservices share a datastore
  • ✅ Your microservices share a lot of the same code or models
@jeromecoupe
jeromecoupe / webstoemp-gulpfile.js
Last active April 11, 2025 08:17
Gulp 4 sample gulpfile.js. For a full explanation, have a look at https://www.webstoemp.com/blog/switching-to-gulp4/
"use strict";
// Load plugins
const autoprefixer = require("autoprefixer");
const browsersync = require("browser-sync").create();
const cp = require("child_process");
const cssnano = require("cssnano");
const del = require("del");
const eslint = require("gulp-eslint");
const gulp = require("gulp");
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.

package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@nickbayley
nickbayley / alt-ssh-copy-id.md
Last active September 5, 2024 12:09
Simple Alternative to ssh-copy-id

Simple Alternative to ssh-copy-id

Replace user with the name of the user you want to ssh as.

Replace the ip with the ip of the machine / host / vps you want to connect to.

cat ~/.ssh/id_rsa.pub | ssh user@ip "cat >> ~/.ssh/authorized_keys"
@rishubil
rishubil / README.md
Last active March 3, 2023 22:50 — forked from Lazza/README.md
VPNGate for OS X

VPNGate for OS X

This script is a simple script for using to connect vpn server list provided VPNGate through OpenVPN on OS X environment.

It inspired by VPNGate Python script wrtten by Andrea Lazzarotto.

Requirements

If you use the script, Tunnelblick needs to be installed first.

Installation

Open terminal app and copy & paste the command below.

@Lazza
Lazza / README.md
Last active October 16, 2024 08:17
VPNGate Python script

This script is NOT MAINTAINED

This snippet of code was posted in 2014 and slightly revised in 2016 and 2017. It was more of a quick'n'dirty script than a polished tool. It is made only for Linux and in Python 2, which has since become outdated.

I currently do not use it, and I suggest you avoid it as well. Please do not expect support for using this script.

🔥 If you need an alternative, @glaucocustodio has kindly suggested EasyVPN in this comment.

The rest of the README is left for historical purposed.