Twitter Screenshot Bot

Do you need a static record of a tweet for future reference? If the answer is yes, you need Twitter Screenshot Bot.

Twitter Screenshot Bot takes screenshots of tweets. Just mention it’s name (@get_screenshot) in a reply tweet and it will take a screenshot of the main tweet and send the screenshot to you.


Cloudflare + AWS API Gateway

So you want to use Cloudflare SSL certificates with AWS API Gateway?

First, create an origin certificate in Cloudflare’s and then import it into the AWS Certificate Manager.

Cloudflare -> SSL/TLS-> Origin Certificate -> Create Certificate


Placeholder-cli is an open-source command-line tool that replaces images with placeholders.

If your project uses images that require a distribution license, you may use this tool to replace them.

The tool generates placeholders on the fly with the exact width and height as the image.

Did I mention those generated placeholders don’t have a watermark:)?

Watch the tool in action:


An example application demonstrating how to add route paths to a map using the MapBox Javascript library.

The example covers topics such as:

  • Address geocoding
  • Adding markers
  • Directions API
  • Adding routes

Source code can be found on Github and a demo can be viewed here.

Example of adding route paths to a map


Copy to Gist is a Chrome extension that lets you copy selected text from a page to a gist. You can use it to streamline the process of adding gists to medium articles. For example, the following Javascript code was selected, copied to a gist and pasted below.

var foo = function(){console.log("hello world");
}


PlotlyChartExport is a chart rendering module that renders static plot.ly charts on the server. It’s a lightweight module designed for serverless environments.

  • Only 1 Dependency
  • Works in Serverless Environments
  • Size < 10MB

Checkout PlotlyChartExport on Github:

https://github.com/mbejda/plotlychartexport

Find PlotlyChartExport on NPM :

https://www.npmjs.com/package/plotlychartexport

Learn how to create Plot.ly Charts As a Service on AWS :

https://www.mbejda.com/creating-serverless-chart-exports-with-plotly/


FireDeploy is a CLI tool which can also be used as a dependency module to deploy single page applications to Firebase from serverless environments. It is a lightweight alternative to the firebase `firebase-tools` cli. It does not rely on heavy dependencies such as firebase, firebase-tools(190M), firebase-admin and weighs < 10mb.

  • Does not use Firebase modules
  • Size < 10mb
  • Only has 7 dependencies
  • Can be used as a CLI or module dependency

RXJS has a broad set of observable operators such as flatMap, mergeMap, concatMap, that can be used to do nifty things. One particular operator that I will cover in this post is called switchMap. A switchMap is not a switch statement in the traditional sense where you define a list of conditions along with logic blocks and invoke a logic block that satisfies a condition, rather it is a handy control flow operator that can be used to prevent race condition problems on the frontend.

What are Race Condition Problems?

Race condition is an undesired situation that occurs when two or more operations need to…


ECMAScript 6 brought us some wonderful features and helped alleviate some Javascript pains. One particular pain I wrestled with for a long time deals with the way JavaScript initialized it’s objects.

Before ECMAScript 6, initializing an object with a variable as a key was a 2 step operation. You would first initialize the object, and then you would give it a variable key while assigning it a value.

Here is an example of what l’m talking about:

Initializing JS object with variable as a key in 2 steps.

EWWWWW. Thankfully those nightmarish days are now gone and never coming back. Because of the new ECMAScript 6 features, we can now make this hard to bear 2 step operation just a 1 step.

Initializing JS object with variable as a key in 1 step.

Don’t believe me? Here is a jsFiddle!


For to often I see developers do something like this

The code block loops through an array of numbers and adds them to a number outside the loop. The end result will produce a variable that contains the sum of all numbers in the array.

However, the solution can be expressed in terms that correspond to the problem being solved. Even though the results are going to be same, future developers who may inherit that code will thank you for having a clear and concise code block.

Milos Bejda

AWS Devops Guy (mbejda.com)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store