Skip to content

Instantly share code, notes, and snippets.

@robertranjan
robertranjan / pre-commit.md
Last active November 13, 2024 00:36
pre-commit hook to prevent binary check-ins

Navigate to hooks folder and make pre-commit script

cd ${GIT_REOP}/.git/hooks
cp pre-commit.sample pre-commit 

Add below code to pre-comit script

function checkForBinaries() {
    binaryFilesCount=0

echo "PWD: ${PWD}"

@robertranjan
robertranjan / upload.go
Last active October 16, 2020 21:24 — forked from ebraminio/upload.go
golang upload client and server
// curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload
package main
import (
"fmt"
"io"
"net/http"
"os"
// "time"