Skip to content

Instantly share code, notes, and snippets.

View soheilous's full-sized avatar

SoHeil Vatanpoor soheilous

  • Sweden, Stockholm
  • 18:39 (UTC +03:30)
View GitHub Profile
@mskelton
mskelton / set-package-manager.sh
Created August 29, 2023 02:08
Set the packageManager key in package.json to the latest version of the given package manager
#!/usr/bin/env bash
# Ensure there is a manifest file
if [[ ! -f package.json ]]; then
echo "error: no manifest file found"
exit 1
fi
# Get the repo name for the given package manager
if [[ $1 == 'npm' ]]; then
@mitjafelicijan
mitjafelicijan / compile-redis-portable.sh
Created January 15, 2018 20:21
Creates portable version of Redis (Linux)
#!/bin/sh
# http://download.redis.io/releases/
# Usage: sh compile-redis-portable.sh
VERSION="4.0.6"
INIT_PATH=`dirname "$0"`
INIT_PATH=`( cd "$INIT_PATH" && pwd )`
@sephiroth74
sephiroth74 / git pretty stat
Last active November 29, 2024 08:17
Show lines added/deleted and total commits per author in a period of time on all branches
git log --all --numstat --pretty="%H" --author="author" --since=1.year | awk 'NF==3 {plus+=$1; minus+=$2} NF==1 {total++} END {printf("lines added: +%d\nlines deleted: -%d\ntotal commits: %d\n", plus, minus, total)}'