Skip to content

Instantly share code, notes, and snippets.

View codesharpdev's full-sized avatar
🏠
Working from home

Salman Saifi codesharpdev

🏠
Working from home
View GitHub Profile
@codesharpdev
codesharpdev / .htaccess
Created November 22, 2022 17:24 — forked from jiceb/.htaccess
Remove trailing slash with .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# where the magic is done !
RewriteRule (.*)/$ $1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
@codesharpdev
codesharpdev / worktree-publish-to-gh-pages.md
Created January 26, 2023 18:32 — forked from lajlev/worktree-publish-to-gh-pages.md
Publishing a `dist` folder from `master` branch using **worktree** feature to `gh-pages` branch.

Setup

First of all, you need to have a gh-pages. If you don't have, create:

git branch gh-pages

This makes a branch based on the master HEAD. It would be okay but the files and the git history of master branch are not meaningful on gh-pages branch.

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@codesharpdev
codesharpdev / git-aliases.md
Created June 7, 2024 07:04 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc