Invest in Real Estate or Stock Market (and Other Comparisons)

Average rate of return

ROI based on own money or borrowed money

  • If you invest $100,000 in stocks, with a 10% ROI, you’ll get $10,000 at the end of year one.
  • If you invest $100,000 in real estate (20% of a $500,000 house), with a 10% ROI, you’ll get $50,000. Your ROI is based on the value of the property ($500K), not your $100K down payment. Most of your ROI comes from borrowing $400,000 from the bank.

Of course, you can also borrow $400,000 and dump it all into buying stocks but

  1. no one, especially a bank, would lend you $400,000 to invest in stocks, and even if they did, the interest rate would be more than 10%, causing you to lose money
  2. unless you invest in something like index funds, investing in individual stocks is more risky because their values can plummet in very short periods of time, e.g. Facebook dropped by 26.4% in just one day. A single-day devaluation like that would never happen in real estate. Real estate depreciation can occur, but it would take at least months.
Facebook biggest one-day US stock plunge
Continue reading Invest in Real Estate or Stock Market (and Other Comparisons)

Change the Color of Images Using CSS

If you have a logo, for example, that is a transparent PNG or SVG, you can change its color using CSS in the following ways:

Grayscale:  filter: grayscale(100%);
Solid Gray: filtercontrast(0);
Solid Black:  filter: contrast(0) brightness(0);
Solid White:  filter: contrast(0) brightness(2);

You can adjust the contrast value between 0 and 1 to achieve different levels of darkness.

Easiest Way to Make Good Steak

Instructions

  1. Buy steak meat (ribeye, new york,etc) (e.g. from Costco)
  2. Measure the thickness of the meat, e.g. 1.25 inches thick
  3. Preheat an indoor grill to the max temperature. I have the Hamilton Beach 25361 Electric Indoor Searing Grill. Choose the “sear” setting which is the max temperature.
  4. Pat both sides of steak with paper towel to dry it as much as possible
  5. Smear 1.5 tablespoons of olive oil or melted butter on both sides of meat
  6. Put salt and pepper on both sides of meat (don’t be afraid to put more than you think – the thicker the meat, the more the salt and pepper)
  7. Insert a cooking temperature probe through the side of the steak until the tip is at the center of the thickest part of the meat. My probe has a silicone cord so it can withstand high temperatures.
  8. For a medium done steak, the internal temperature should be 135 degrees.
  9. When preheating is done (green light turns on), put the meat on the grill, close lid, and grill for 7 minutes.
  10. After 7 minutes, turn over on grill.
  11. When the internal temperature reaches the desired temperature, e.g. 135 degree, the probe will beep. Turn off the grill, move the steak to a plate, cover it, and let it rest for 2 minutes. During these 2 minutes, the internal temperature will rise a few degrees, which is expected, and the steak will be juicier.
  12. After 2 minutes, eat and enjoy

Notes from JS Conference Workshop: Extreme Web Performance

WPO

WPO stands for Web Performance Optimization. It’s similar to SEO and it’s a real field of interest. The Velocity conference just deals with WPO.
https://conferences.oreilly.com/velocity/vl-ca

Optimization Comparison

Service optimization makes up 16%. If you optimize the server by 50%, you see a 10% improvement.
Front end optimization makes up 84%. If you optimize the front end by 50%, you see a 45% improvement.

Continue reading Notes from JS Conference Workshop: Extreme Web Performance

Notes from JS Conference Workshop: Mastering Chrome Developer Tools

JavaScript Debugging

There’s an ability to blackbox JavaScript libraries like jQuery so that when you step over lines of code, you’ll step over these 3rd party libraries. There’s also an ability to set breakpoints on event listeners which can be very handy. Under Settings, you can globally blackbox 3rd JS libraries so you don’t have to blackbox every time you open Chrome. There’s also the ability to create conditional breakpoints, e.g. to break when your about to execute an XHR (AJAX) request to a certain URL.

Editing CSS

When you edit CSS in the Elements tab, you can have those edits write to the source CSS file, and vice-verse from the source file to Chrome. This only works for CSS. To do this, drag your CSS file or entire project folder into the Sources tab. If Chrome can’t auto-map, you can manually map the CSS file.

Continue reading Notes from JS Conference Workshop: Mastering Chrome Developer Tools

Energy Star Light Bulbs

Light bulb wattage doesn’t always result in the same brightness. If you buy light bulbs, find EnergyStar ones were the lumens are within the following ranges

Learn more at https://www.energystar.gov/products/lighting_fans/light_bulbs/key_product_criteria

Rated Wattage of the Referenced Incandescent Lamp (watts) Light Output (Lumens)
25 250-449
40 450-799
60 800-1,099
75 1,100-1,599
100 1,600-1,999
125 2,000-2,549
150 2,550-3,000
200 3,001-3,999
300 4,000-6,000

Deploy Cloud9 Changes via S/FTP Using Git and PHPloy

Cloud 9 already comes with Git, PHP and Composer.

——————–
EXAMPLE FOLDER STRUCTURE
——————–
/home/ubuntu/website1
/home/ubuntu/website2
/home/ubuntu/website3
/home/ubuntu/PHPloy

——————–
INSTALL PHPLOY
——————–
Go to https://github.com/banago/PHPloy
Download and unzip the repo
Create a folder called “PHPloy” in Cloud9 in the “workspace” folder so that that folder is a sibling of your website folder(s). Continue reading Deploy Cloud9 Changes via S/FTP Using Git and PHPloy

Stereo vs Surround Sound

A lot of people don’t really understand the difference between stereo and surround sound and usually just assume that surround sound is better. Based on my research, here’s a summary of the differences.

Surround Sound

  • Intended to hear some sounds at different places around you, e.g. an ambulance zooming by in which case you’d hear the siren begin from one side of a room and end on the other
  • Most surround sound systems involve 5 speakers and 1 subwoofer (5.1 system). For long rooms, there may be 7 speakers and 1 subwoofer (7.1 system).
  • Surround sound is most often noticeable in action movies, e.g. you can hear explosions behind you. Surround sound is subtle in drama movies, e.g. you might hear the leaves moving in the background and some traffic in the distance.

Stereo Sound

  • Very little music is recorded in surround sound.
  • Stereo systems require a front left and front right speaker.
  • Stereo creates a sound-field that, more or less, is shaped like a performance stage that is situated in front of you–as if you’re sitting in a theater. Surround sound does too but adds sound at the top, back and sides of you.

Continue reading Stereo vs Surround Sound