This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Term::ANSIColor; | |
my $latest_commit = `git log --oneline -n 1`; | |
my ($commit_hash) = $latest_commit =~ /^([0-9a-f]+)/; | |
my $commit_length = length $commit_hash; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Uses clang-format-15 | |
AccessModifierOffset: -4 | |
AlignAfterOpenBracket: Align | |
AlignArrayOfStructures: Right | |
AlignConsecutiveAssignments: | |
Enabled: true | |
AcrossEmptyLines: false | |
AcrossComments: true | |
AlignCompound: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
UPSTREAM=$1 | |
HEAD=$2 | |
HASHES=$(git cherry "$UPSTREAM" "$HEAD" | grep -F '+' | tr -d '+ ' | cut -c 1-7) | |
HASH_REGEX="/$(echo "$HASHES" | paste -sd '|' -)/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const { sync: globSync } = require('glob'); | |
const { moveSync } = require('fs-extra'); | |
const { exit } = require('process'); | |
const dir = process.argv[2]; | |
const oldExt = process.argv[3]; | |
const newExt = process.argv[4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
create_package_json() { | |
cat << EOF > package.json | |
{ | |
"name": "", | |
"version": "1.0.0", | |
"description": "", | |
"main": "build/main.js", | |
"scripts": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Delete gone remote branches | |
git remote prune origin | |
# List all local branches that were published to the remote and delete them | |
git branch -v | awk -e '/gone/ { print $1 }' | xargs git branch -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CURRENT_BRANCH=$(git branch --show-current) | |
git push -u origin $CURRENT_BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git fetch > /dev/null | |
CURRENT_BRANCH=$(git branch --show-current) | |
OUTDATED_BRANCHES=$(git branch -v | grep 'behind' | tr -d '*' | awk '{ print $1 }') | |
for BRANCH in $OUTDATED_BRANCHES | |
do | |
git checkout "$BRANCH" | head -1 |