Skip to content

Instantly share code, notes, and snippets.

View sarvsav's full-sized avatar
🌲
golang - green developer

Sarvsav Sharma (Max) sarvsav

🌲
golang - green developer
View GitHub Profile
  1. How to map the git bash home folder in windows?

Open git bash and cd to root folder and type explorer . and it will open the folder in windows.

@sarvsav
sarvsav / download_latest_release.sh
Created March 5, 2024 20:12
Download the latest release from the github repo
#!/bin/bash
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "jq is required but it's not installed. Please install jq first."
exit 1
fi
# Check if curl is installed
if ! command -v curl &> /dev/null; then
@sarvsav
sarvsav / packages.sh
Created April 15, 2023 20:57
Installing packages to bin directory
## Create a bin directory in your home directory, if not exists
mkdir -p ~/bin
## find the url for latest version of the hadolint
latest_hadolint=$(curl -sL https://api.github.com/repos/hadolint/hadolint/releases/latest | jq -r '.assets[].browser_download_url' | grep -i windows | grep -iv 256)
## Download the hadolint binary to the bin directory
curl -sL $latest_hadolint -o ~/bin/hadolint.exe
@sarvsav
sarvsav / Makefile
Created April 10, 2023 20:00 — forked from thomaspoignant/Makefile
My ultimate Makefile for Golang Projects
GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=example
VERSION?=0.0.0
SERVICE_PORT?=3000
DOCKER_REGISTRY?= #if set it should finished by /
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
GREEN := $(shell tput -Txterm setaf 2)
@sarvsav
sarvsav / Information.md
Created January 27, 2022 15:51
Excel data

Step 1: Export the file to csv format.
Step 2: Remove the empty rows from the file by running below command:

grep -iv ",,,,," file_name.csv > data_clean.csv

Step 3: Run below script

#!/usr/bin/env bash
echo "" > data_cleaned.csv
counter=0
@sarvsav
sarvsav / embed-gist-in-blogger.js
Created January 23, 2022 08:38 — forked from hanxue/embed-gist-in-blogger.js
Embed Gists in Blogger
At the end of your Blogger post , using HTML editor, append this
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
In the content of your blog post, simply add this:
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div>
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves.
@sarvsav
sarvsav / PHP Project
Created September 25, 2015 18:50
PHP project directory structure, recommend by zend
<project_name>/
application/
configs/
application.ini
controllers/
helpers/
forms/
layouts/
filters/
helpers/
@sarvsav
sarvsav / Bash project
Created September 25, 2015 18:48
Bash project directory structure
├── bin => Contains binary of your project
├── docs => Contains documentation and future aspects about your project
│ └── ToDo => ToDo List of your project
├── etc => Add configuration files under this directory
│ └── imdb-xplorer.cfg => Configuration file
├── LICENSE => Add license for your project
├── logs => This directory contains logs about behaviour of your script
│ └── imdb-xplorer.log => log file
├── README.md => Contains how to install, and use your project
├── setup.sh => install the project on your machine
@sarvsav
sarvsav / Game Projects
Created September 25, 2015 18:47
For C++ game projects
|── autogen.sh
├── CODING_STANDARDS.md
├── configure
├── data
│ ├── characters.json
│ ├── font
│ │ ├── font.ttf
│ ├── images
│ │ ├── animation
│ │ │ └── running
@sarvsav
sarvsav / Simple_Projects
Created September 25, 2015 18:43
Project Directory Structure for simple C++ applications
./ Makefile and configure scripts.
./src General sources
./include Header files that expose the public interface and are to be installed
./lib Library build directory
./bin Tools build directory
./tools Tools sources
./test Test suites that should be run during a `make test`