Skip to content

Instantly share code, notes, and snippets.

View kevinreynolds's full-sized avatar

Kevin Reynolds kevinreynolds

View GitHub Profile
@kevinreynolds
kevinreynolds / Git Sync Local Branches with Remote.md
Created October 10, 2022 18:06 — forked from krshnpatel/Git Sync Local Branches with Remote.md
A simple script to help you sync your local branches with your remote branches.

Overview

Description

This script allows you to sync your local branches with your remote branches. It would detect any local branches that have been deleted on your remote repository. Any local branches that have not been pushed to remote will not be detected because they might be your "work in progress" branches.

NOTE: If you create a local branch, then push it to your remote repository, then you manually delete that branch on your remote repository. This script will detect that local branch. So I would suggest reading the list of branches marked for deletion before allowing this script to delete them.

Purpose

Usually it's a good practice to delete your remote branch after it has been merged to your default branch (i.e. main, master). However, this means that there will be several stale local branches and these will accumulate over time. Essentially, this script will help you delete those stale local branches which have been deleted on the remote repository.

@kevinreynolds
kevinreynolds / btc-eth-dca-buy.php
Created August 24, 2017 18:57 — forked from levelsio/btc-eth-dca-buy.php
This script runs daily and "Dollar Cost Average"-buys $40 BTC and $10 ETH per day
<?
//
// [ BUY BTC & ETH DAILY ON BITSTAMP ]
// by @levelsio
//
// 2017-08-23
//
// 1) buy $40/day BTC
// 2) buy $10/day ETH
//
@kevinreynolds
kevinreynolds / HexadecimalColorRegex
Created August 14, 2017 07:28 — forked from LunaCodeGirl/HexadecimalColorRegex
Regex for validating hexadecimal color codes.
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
^ #start of the line
# # must constains a "#" symbols
( # start of group #1
[A-Fa-f0-9]{6} # any strings in the list, with length of 6
| # ..or
[A-Fa-f0-9]{3} # any strings in the list, with length of 3
) # end of group #1