Posted on Jun 15, 2019
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.
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
Posted on Jun 5, 2019
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.
it’ll redirect to
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
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.
At that point, Apache would redirect to
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.
Posted on May 17, 2019
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.
If a function doesn’t return a Promise but rather a callback, like Node’s fs.readile function,
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.
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.
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.
Posted on May 9, 2019
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”
Posted on May 3, 2019
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.
You can calculate how many calories you burn per day based on different types of activities.
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.
You can find nutrition facts for a wide variety of food at https://www.nutritionix.com
Total daily calorie consumption: 818
Net daily calorie gain/loss: 818-1818 = -1000 calories (-1/3 lb)
Posted on May 1, 2019
Posted on Apr 23, 2019
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
Posted on Apr 22, 2019