Cleaning Tips

Microfiber cloths (available at Costco)

  • for wiping kitchen, windows, glass, etc

Pressure Washer (available at Costco)

  • clean driveway
  • clean house exterior
  • clean fence

Clorox Disinfecting Wipes (available at Costco)

  • clean glass, including hard (mineral) water stains on shower glass
  • clean soap scum on shower tiles
  • clean dirt and soap scum on vanity and sink bowls
  • clean stainless steel appliances
  • clean kitchen countertops
  • clean microwave interior
  • clean faucets

Continue reading Cleaning Tips

Working with GitHub and Git Using the Command Line

Create a repo called “test” in GitHub

Create a new repo in GitHub called “test” and check the checkbox to initialize it with a README.md file.

This repo called “test” will contain a default branch called “master”. On your local machine, this GitHub repo is called “origin” by default because it is the repo you “originally” cloned from. The “master” branch is usually used for production. Together, this repo and branch are referred to as “origin/master” (remote name / branch name).

Create a “develop” branch in GitHub

If you need a separate branch for development, you can create it and call it “develop”. If you create this branch in the “test” repo on GitHub, it will be called “origin/develop”.

Get GitHub clone URL

In GitHub, get the URL to clone the repo, e.g. https://github.com/javanigus/test.git

Go to local projects folder

On your locale machine, go to a folder where you want this project to exist, e.g. /Users/ayahya/Projects/

cd /Users/ayahya/Projects/

Clone the remote repo on GitHub to your local machine

git clone https://github.com/javanigus/test.git

This will create a folder that is the name of the repo, e.g. “test”

Go to the repo folder

cd test

Since it says “master*”, then the files within it are set up to track remote branch “master” from origin.

See what’s in the repo folder

Using the “ls” command, we see the same, one file (README.md) that is in GitHub.

See the log

git log

HEAD is a reference or pointer to the last commit in the currently checked-out branch (master). Notice that origin/master (remote) and origin/develop (remote) and local master and local develop are in sync because they are listed on the same line.

List remote repos

git remote

We see that we only have one remote repo called “origin”.

Switch to the develop branch

git checkout develop

Since it says “develop*”, then the files within it are set up to track remote branch “develop” from origin.

List all branches

git branch

Since there is a * beside “develop” and it is highlighted, the local files are set to track remote branch “develop” from origin.

Open the project in a text editor and edit a file

In this case, I added the text on line 3.

View the status of your local files

git status

The README.md file has been modified.

Undo (revert) the modification

git checkout - README.md

View the status of your local files

git status

The local branch is up to date with origin/develop on GitHub.

Redo the modification

View the status of your local files

git status

Stage (add) the modified file so it can be committed

git add README.md

or

git add .

View the status of your local files

git status

Unstage the modified file

git reset HEAD README.md

Check the status of the files

git status

Restage (re-add) the modified file so it can be committed

 git add README.md

Commit the modified file

git commit -m "added one line"

View the status of your local files

git status

Now, the local “develop” branch is ahead of the remote “develop” branch (origin/develop) by 1 commit. Also, there is nothing else to commit and the working tree is clean.

Check the log

This shows that local “develop” branch is ahead of local “master” branch, remote “master” and remote “develop” by 1 commit.

Push local changes to remote

We’ll push local branch “develop” to origin/develop on GitHub.

git push origin develop

On GitHub, in the “develop” branch, you’ll see the added line.

Check the log

Now we see that both local and remote “develop” branches are in sync and ahead of local and remote “master” branches by 1 commit.

Switch to master branch

git checkout master

Merge changes from “develop” to “master”

The local “master” branch doesn’t have the changes in “develop”. Let’s merge the changes from the local “develop” branch into the local “master” branch.

git merge develop

View the status of your local files

git status

The local “master” branch is now ahead of the remote “master” branch (origin/master) by 1 commit.

See the log

Now we see that local “master”, local “develop”, and remote “develop” are in sync and ahead of remote “master” by 1 commit.

Push local changes from remote

We’ll push local branch “master” to origin/master on GitHub.

git push origin master

View the status of your local files

git status

The local branch is now up-to-date with origin/master on GitHub.

On GitHub, in the “master” working tree you’ll see the added line.

Check the log

Now all branches, local and remote, are in sync.

Make a change on origin/master and commit it

In this case, I added line 4.

Check status of local “master” branch

git status

We see that our local “master” branch is in sync with remote “master” branch even though we just committed a change in remote “master”.

Fetch updates from remote repo

In order to see what has changed remotely, run git fetch.

Check status of local “master” branch

Now, we correctly see that our local “master” branch is behind the remote “master” branch (origin/master) by one commit.

Pull changes from GitHub (origin/master) down to local “master”

git pull 

Check status of local “master” branch

git status

Local and remote “master” branches are in sync again.

Check the log

Now we see that local and remote “master” branches are ahead of local and remote “develop” by 1 commit.

See what changed

To see a change in a particular commit, run git diff on the commit, e.g. to see the most recent change (commit 850d7dad8bde14775ea640be860a04c9d061fa41), we run

git diff 850d7dad8bde14775ea640be860a04c9d061fa41~ 850d7dad8bde14775ea640be860a04c9d061fa41

Make another change on origin/master and commit it

This time I added line 5.

Fetch changes and check status

We see that local “master” is behind remote “master” by 1 commit, as expected.

Edit local “master” and commit it BEFORE pulling changes from remote “master”

I added line 5

Check status

Now we see that local and remote master have each diverged because we didn’t do a pull before committing.

Run git pull to merge remote “master” into local “master”

We see a conflict because the change in remote “master” and local “master” was in the same file and on the same line (line 5).

Resolve conflicts

Open the file containing conflicts and edit it.

Since we want to keep both lines, just remove the conflict divider markers.

Check status

Mark conflict resolved

To mark the conflict as resolved, use “git add” and then check the status.

We see that the conflicts have been fixed but we are still merging.

Commit the merge

To avoid having diverged commits and pull conflicts, always do a git pull before committing.

Check status and log

We see that

  • local “master” is ahead of remote “master” by 2 commits
  • local “master” is ahead of local and remote “develop” by 4 commits
  • remote “master” is ahead of local and remote “develop” by 2 commits

Push local changes to remote

Check log

Now local and remote “master” are in sync and are ahead of local and remote “develop” by 4 commits.

IrfanView for Batch Image Processing

When you’ve got a bunch of images to process, IrfanView makes the process simple and quick. Here’s an example of how to

  • auto trim / remove whitespace
  • resize images
  • optimize JPGs

Open IrfanView and do the following:

  1. File > Batch Conversion / Rename
  2. Work As: check “Batch Conversions”
  3. Look In: Browse to the folder containing all of the images then click “Add All”
  4. Batch Conversion Settings: choose “JPG”, click “Options”, for “Save as quality” choose 65, check “Save as progressive JPG”
  5. Batch Conversion Settings: click “Advanced”,
    1. check “Auto crop borders”
    2. check “RESIZE”, check “Set new size”, for “Set new size to” enter “750” pixels, check “Don’t enlarge smaller images”
  6. Output Directory: create and choose a different directory, e.g.  a subfolder called “processed”
  7. Click “Start Batch”

Affordable Hi-Fi Audio Headphone Setup

So, I’ve been trying to get more out of my music in terms of sound quality and experience. 6 years ago, I thought $30 Sony in-ear earphones were just as good as $200 earphones. Clearly my ears were not trained to know any better. As time went on, I slowly began to notice the difference between quality speakers and crappy ones. I still wanted earphones for their small size and I eventually settled on the BeatsX (bluetooth) which cost $109. The BeatsX are definitely much better than my $30 Sony earphones. Then, as time went on, I noticed that music played in my car sounded better than my BeatsX. One particular experience is the surround sound feeling you get from music in your car. With 6 separate speakers, the sounds from different instruments would appear to come from different directions in a very harmonious way. Since I wanted that experience at home, my research led me to a sound factor called soundstage. The soundstage is a speaker’s or headphone’s ability to add spatiality to the music you’re listening to. Rtings.com explains soundstage in detail and sorts headphones by soundstage. You can see the explanation and ranking at

https://www.rtings.com/headphones/tests/sound-quality/soundstage

With this ranking, I just went down the list and picked the best headphones in my budget. Here are the prices for the top 4 headphones as of this writing:

Continue reading Affordable Hi-Fi Audio Headphone Setup

Easily Create Curved Arrows on Mac Using Preview

When you need to annotate a document and explain certain parts of it, using arrows can be very helpful. If you’re on a Mac, adding arrows, both straight and curvy, is very easy using the Preview application. Here’s how to do it

  1. Open an image in Preview
  2. Open the Toolbar (View > Show Toolbar)
  3. Click on the “Sketch” icon (3rd from the left) so that it’s highlighted blue

  4. Choose a line thickness

  5. Click and drag to create a curved line with an arrow just as you would with a pen without lifting the pen. This will result in a curved arrow.

  6. If the curvature doesn’t look right, adjust it by moving the 3 control points.

  7. Then add some text by clicking on the text tool (last icon with the letter A)

    You can also create straight lines by drawing a line. Preview will detect that you are trying to draw a line and make it straight for you.

How to Survive Ramadan By Not Feeling Hungry

Many people dread Ramadan — especially in the US since we don’t get to work half days — because working when you are hungry is challenging and can sometimes give you a literal headache. Every year, I research foods and try to find the right combination of types of food to eat right before fasting each day (around 4 AM). This year, 2018, I believe I’ve come up with a good list. Based on the USDA’s Dietary Reference Intake calculator, I should consume each day

  • 38 grams of fiber
  • 69 grams of protein

Since we normally eat twice in Ramadan, once in the early morning before beginning your fast and once at night when breaking your fast, we can split these daily values (DV) up, e.g. in half, so that my target for breakfast in the morning would be

  • 19 grams of fiber
  • 36 grams of protein

Fiber gets processed slowly in your stomach which makes you feel full longer. Protein is an essential source of energy.

So here’s my list:

One cup of oatmeal

I like the Simply Balanced Organic to-go cups of oatmeal available at Target. These cups cost $1.49 each and are super convenient to prepare in the morning. Just add water, microwave for 50 seconds, stir, eat, then throw away the cup. There are 3 flavors:

Cranberry

Continue reading How to Survive Ramadan By Not Feeling Hungry