Using Google Drawings to Easily Annotate Images

When reviewing websites, you often want to point at certain elements and add comments about them. This can easily and freely be done using Google Drawings.

  1. Take a screenshot of part of your screen onto your clipboard
  2. Open Google Drawings and paste the screenshot

3. Click one of the Callout buttons

4. Click and draw near the element in the screenshot where you want to add a comment

5. Drag the orange point at the tip of the arrow and drag it towards the element you want to draw attention to

6. Click in the callout box and type your comment then optionally adjust the size of the box

 

Default Apache on Heroku Redirects From https to http for Links Without Trailing Slash

I recently set up a Heroku app using the Apache and PHP buildpack. The Apache configuration on Heroku was most likely the default which, if it receives a request to a URL without a trailing slash, e.g.

http://www.foobar.com/about

it’ll redirect to

http://www.foobar.com/about/

That alone is fine. However, I was getting redirected from https to http, which was not fine. This is likely due to the presence of a load balancer in front of the Heroku app server with SSL/TLS being terminated at the load balancer. When a request to an https URL without a trailing slash like

https://www.foobar.com/about

the request was secure to the Heroku load balancer but from the load balancer to the Heroku app server, it must have been insecure, e.g.

http://www.foobar.com/about

At that point, Apache would redirect to

http://www.foobar.com/about/

and the user would end up going from https to http. To resolve this, and as a best practice, just force https on all URLs. This is easily done on Heroku using a .htaccess file with a redirect rule, in case your chosen server is Apache.

 

JavaScript Promises

Using Promises

Say we have an API client with three methods, getItem(), updateItem(), and deleteItem(), each of which returns a Promise. There are only two functions you need to worry about: then() and catch().

Each call to then() creates another step in the Promise chain, and if there’s an error at any point in the chain, the next catch() block will be triggered. Both then() and catch() can either return a raw value or a new Promise, and the result will be passed to the next then() in the chain.

Convert callback to Promises

If a function doesn’t return a Promise but rather a callback, like Node’s fs.readile function,

https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback

then you can convert the call to a Promise as follows. The new function, called readFilePromise, converts the original function, called readFile, into a Promise.

To use the new promise function, do this.

To create Promises out of ordinary values, use Promise.resolve() and Promise.reject().

If you have a function that needs to return a Promise, like fs.readFile, but handle certain cases synchronously, you can use Promise.resolve() and Promise.reject() to create Promises out of ordinary values, like this.

Running concurrently

Promise.all is a convenient method for running an array of Promises concurrently, i.e. all at the same time. For instance, say we have a list of files we want to read from disk. Using the readFilePromise function we created above, it would look like this:

Here’s another example

And another example (from Kyle Simpson)

In the example above, we can use the new Promisified function in the chain as follows. We can also create a new Promise that returns a Promise of an ordinary value to keep the chain going.

How to Use a Ratchet Strap

Hook both ends of the ratchet strap to something.

Fold the ratchet as shown in the picture below. Then insert the open end of the other strap “through” the ratchet cylinder. Read More

Create a Custom Google Map with Placemarkers

When traveling, it’s super handy to be able to see a map of just the places you want to visit. This can easily be done with Google Maps. In addition, with Google Maps you can zoom in and out and get directions to each place of interest. Here’s how to create a custom Google Map with your choice of places.

1. Go to maps.google.com and log in
2. Click the hamburger menu icon and then “Your Places”
3. Click the “Maps” tab
3. At the bottom, click “Create Map”
4. In the search bar, enter the name or address of a place then click the search button.
5. Google Maps will place a balloon on the map where the place it along with a description box.
6. In the description box, click “Add to map”

7. Repeat steps 4-6 adding as many locations as you’d like
8. To make it easier to see the location, change the color and details of the base map.

9. To share or embed a map, click the hamburger menu icon and then “Share or embed map”

Losing Weight By Counting Calories

No matter what you eat or how much you exercise, the formula for losing weight is very simple. Burn more calories per day than you consume.

Calorie Calculator

You can calculate how many calories you burn per day based on different types of activities.

https://www.calculator.net/calorie-calculator.html

To be safe, you can calculate your basal metabolic rate (BMR) which is how many calories you burn doing absolutely nothing and just doing the bare minimum to live (breathe, etc).

For me, my BMR is 1818 calories / day.

Weight loss facts
  • You should not lose more than 2 lbs / week.
  • 1 pound (~0.45 kg) of fat = 3500 calories
  • To achieve a 2 lb weight loss per week, you’d need to lose 1000 calories per day.
Nutrition data

You can find nutrition facts for a wide variety of food at https://www.nutritionix.com

Example calorie calculation
  • Breakfast:
    • Banana Nut Crunch Cereal: 1 cup – 230 calories
    • 2% Reduced Fat Milk: 1 cup – 130 calories
      • Subtotal = 360 calories
  • Lunch: 
    • Something: 177 calories
  • Dinner:
    • Roasted tomatoes: 4 – 88 calories
    • Roasted creamer potatoes: 1 cup – 180 calories
    • Roasted broccoli: 1 spear – 13 calories
      • Subtotal = 281 calories

Total daily calorie consumption: 818
BMR: 1818
Net daily calorie gain/loss: 818-1818 = -1000 calories (-1/3 lb)

Additional Information

Galayet Bandora with Beef Recipe

Ingredients:
  • 2 medium size onions,finely sliced.
  • 4 Tablespoons of olive oil.
  • 1 serrano pepper, diced
  • 300gm beef meat (cubes or minced).
  • 3 cups of chopped tomatoes.
  • 1 green bell pepper, finely sliced.
  • Salt and black pepper to taste.
Directions:
  1. In a heavy skillet like cast iron add olive oil over medium heat.
  2. Add onions and cook them until soft.
  3. Add meat and stir using a wooden spoon tell it is almostly cooked.
  4. Add tomatoes, serrano pepper, and bell pepper let simmer until the tomato mixture begins to reduce,taste and adjust the seasoning to your liking. cover the skillet, and cook on low heat tell completely cooked.
  5. Serve immediately with warm bread

Strongest Epoxy: JB Weld – Original

Here’s an interesting video comparing the bond strengths of various epoxies. Overall, the JB Weld – Original wins the test. Don’t get JB Weld – KwikWeld or ExtremeHeat as they are weak.

Easily Move Furniture and Carry Heavy or Large Objects

Slide Furniture on Carpet
SuperSliders 4724095N

Place these large 9-1/2″ x 5-3/4″ sliders under your furniture and easily slide your furniture over carpet.

$10 for a pack of 4 sliders on Amazon

Read More

Healthy Yet Tasty Steamed Vegetables Recipe

Ingredients
  • Frozen vegetables (Costco)
  • Salt
  • Pepper
  • Pre-minced garlic in olive oil
  • Water
Preparation
  1. Add water to a steamer pot half an inch below the surface of the holed steamer tray
  2. Boil until you see steam
  3. Add vegetables and baste on minced garlic
  4. Sprinkle on salt and pepper to taste