Skip to content

Instantly share code, notes, and snippets.

View BrianValente's full-sized avatar
👨‍💻

Brian Valente BrianValente

👨‍💻
View GitHub Profile
@BrianValente
BrianValente / .zshrc
Last active April 4, 2025 18:36
Git aliases
# Git: Force push current branch
alias gpf="git push --no-verify --force-with-lease --force-if-includes"
# Git: Get the commit hash from which the current branch was forked
alias gfch="diff -u <(git rev-list --first-parent \$(git rev-parse --abbrev-ref HEAD)) <(git rev-list --first-parent origin main) | sed -ne 's/^ //p' | head -1"
# Git: Rebase interactive commits compared to the branch from which the current branch was forked
alias gri="git rebase -i \$(gfch)"
# Git: Rebase interactive commits compared to the branch from which the current branch was forked with autostash
@BrianValente
BrianValente / .zshrc
Created March 13, 2022 04:42
zsh antigen config
source /opt/homebrew/share/antigen/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
# Syntax highlighting bundle.
antigen bundle zsh-users/zsh-syntax-highlighting
<?php
require __DIR__.'/vendor/autoload.php';
function dateToIso8601($date) {
return $date->format("Ymd") . "T" . $date->format("His") . "Z";
}
function getCurrentDateUtc() {
<?php
$hostsFile = "";
const SLEEP_TIME_SECONDS = 3600; // An hour
function addLine($line, $lineBreaksBefore = 0, $lineBreaksAfter = 0) {
global $hostsFile;
for ($i = 0; $i<$lineBreaksBefore; $i++) {
$hostsFile .= "\n";
<?php
namespace UpsideDownText;
class UpsideDownText {
public static function convert_to_upsidedown_unicode($match)
{
$flipTable = array(
'!' => '¡',
'¡' => '!',