Skip to content

Instantly share code, notes, and snippets.

@shiv043
shiv043 / go-code-convention.md
Created September 1, 2021 14:31 — forked from festum/go-code-convention.md
Golang Guideline

Project Structure

The following content shows a general structure of a web app, it can be changed based on the different conventions of web frameworks.

- templates (views) # Template files
@shiv043
shiv043 / test.py
Last active October 17, 2019 22:17
Assignment
"""
Logic:
Is to keep track of first maximum and
second maximum
"""
def max_second_num_from_arr(arr):
if len(arr) < 2:
return "-1"
first_max = max(arr[0], arr[1])
second_max = min(arr[0], arr[1])
@shiv043
shiv043 / git_empty_branch
Created November 19, 2018 14:34 — forked from j8/git_empty_branch
Create new branch with empty folder structure
You can create a new empty branch like this:
$ git checkout --orphan NEWBRANCH
--orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry.
The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch.
Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory: