Skip to content

Instantly share code, notes, and snippets.

@xieyuschen
xieyuschen / discard_io.md
Created June 16, 2023 02:52
IO.Discard vs /Dev/Null file in Golang

IO.Discard Versus Writing /Dev/Null

Both of them could write down nothing, however, there is still a effieciency difference. Look at the bench:

package base

import (
	"io"
	"os"
	"testing"
@etigui
etigui / python_naming_conventions.md
Last active July 2, 2024 18:25
Python naming conventions

Python naming conventions

This document gives coding conventions example for the Python code. This style guide evolves over time as additional conventions are identified and past conventions are rendered obsolete by changes in the language itself.

1. General

  • Avoid using names that are too general or too wordy. Strike a good balance between the two.
    • Bad: data_structure, my_list, info_map, dictionary_for_the_purpose_of_storing_data_representing_word_definitions
    • Good: user_profile, menu_options, word_definitions
  • Never use the characters as single character variable names:
  • “l“ : lowercase letter el
@odeke-em
odeke-em / ioVsos_test.go
Created June 26, 2016 22:22
io-vs-os:Pipe-comparisons to see which is better for use
package io_vs_os_test
import (
"io"
"io/ioutil"
"os"
"testing"
)
var (
@revett
revett / git_branch_naming.md
Last active December 22, 2023 17:12
Git Branch Naming Conventions

Syntax

<author>/<type>/<ticket>/<title>

Example

revett/feature/24101/skeleton-service-for-email-sender