Skip to content

Instantly share code, notes, and snippets.

View SalahHamza's full-sized avatar

Hamza SalahHamza

View GitHub Profile
@SalahHamza
SalahHamza / git-clearHistory
Created May 22, 2019 05:57 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@SalahHamza
SalahHamza / Local PR test and merge.md
Created March 31, 2019 00:53 — forked from adam-p/Local PR test and merge.md
Testing a pull request, then merging locally; and avoiding TOCTOU

It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream.)

Getting the PR code

  1. Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37

  2. Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it pr37:

$ git fetch upstream pull/37/head:pr37
@SalahHamza
SalahHamza / css_color_naming.md
Last active March 15, 2019 14:14
CSS/SCSS Color Naming Convention

CSS/SCSS Color Naming Convention:

First suggestion

Overview

$color-alpha
$color-beta
$color-gamma
@SalahHamza
SalahHamza / Ruby_On_Rails.md
Last active February 21, 2019 21:30
Professional Ruby on Rails Developer with Rails 5 Course Notes
@SalahHamza
SalahHamza / resources.md
Created November 23, 2018 13:29
Resources
@SalahHamza
SalahHamza / chrome_extension.md
Last active November 19, 2018 13:20
Creating Chrome Extension Notes
@SalahHamza
SalahHamza / http_and_web_servers.md
Last active April 13, 2023 12:37
Udacity's HTTP & Web Servers course notes (ud303)

HTTP & Web Servers

These are the course notes for the HTTP & Web Servers Udacity course, some parts of the notes are taken from the book HTTP: The definitive Guide.

Requirements

Command Line:

You'll be using the command line a lot in this course. A lot of the instructions in this course will ask you to run commands on the terminal on your computer. You can use any common terminal program —

@SalahHamza
SalahHamza / writing_readmes.md
Last active November 6, 2018 01:48
udacity's Writing READMEs course Notes (ud777)

Writing READMEs

Anatomy of a README

When writing a README for a project, make sure to ask yourself these questions:

  • what steps need to be taken to get this code base up and running?
  • what should the user already have installed or configured?
  • what might they have a hard time understanding right away?

A Getting Started or Installation section is often added to help with initial setup that may need to happen before using your code.

@SalahHamza
SalahHamza / version_controll.md
Last active December 13, 2022 06:55
Udacity's Version Control With Git course notes (ud123)

Version Control

What Is Version Control

Version control is a system that records changes to a file or set of files over time so that you can recall specific versions later.

There are two main types of version control system models:

  • the centralized model - all users connect to a central, master repository
  • the distributed model - each user has the entire repository on their computer
@SalahHamza
SalahHamza / bash_commands.md
Last active November 6, 2018 00:59
Some useful bash commands

Useful bash/git Commands

  • Copy folders & exclude some subfolders
rsync -av --progress sourcefolder destinationfolder --exclude thefoldertoexclude

read more here

  • For a list of files to be pushed, run: