The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
- Node.JS
- NPM
- Express
The following guide will show you how to deploy a simple microservice written in JavaScript using 𝚫 now.
It uses Open Source tools that are widely available, tested and understood:
A quick guide on how to setup Node.js development environment.
nvm allows installing several versions of Node.js to the same system. Sometimes applications require a certain versions of Node.js to work. Having the flexibility of using specific versions can help.
| // The cross-browser way to check if the document has loaded in pure JavaScript is using readyState. | |
| if (document.readyState === 'complete') { | |
| // The page is fully loaded | |
| } | |
| // You can detect when the document it's ready... | |
| let stateCheck = setInterval(() => { | |
| if (document.readyState === 'complete') { | |
| clearInterval(stateCheck); | |
| // document ready |
| <cfset jarsPath = expandPath('/java/barcode4j/') /> | |
| <!--- Path where the necessary jar files are located (downloadable from https://www.dropbox.com/s/skl9fwky2n7mnjr/java-files-barcode4j.zip?dl=0) ---> | |
| <cfset libraryList = arrayToList( directoryList(jarsPath, false, 'array', '*.jar') ) /> | |
| <cfset configBuilder = createObject('java', 'org.apache.avalon.framework.configuration.DefaultConfigurationBuilder', libraryList) /> | |
| <cfset barcodeUtil = createObject('java', 'org.krysalis.barcode4j.BarcodeUtil', libraryList) /> | |
| <cfset grayImageType = createObject('java', 'java.awt.image.BufferedImage').TYPE_BYTE_GRAY /> | |
| <!--- create custom config. See http://barcode4j.sourceforge.net/2.1/symbol-ean-13.html ---> | |
| <cfset configXml = '<barcode> |
During installation, create a user called admin rather than one with your own name.
Then install Homebrew as per latest instructions (note that this will install the necessary CLI components for XCode):
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"| # Create a container from the mongo image, | |
| # run is as a daemon (-d), expose the port 27017 (-p), | |
| # set it to auto start (--restart) | |
| # and with mongo authentication (--auth) | |
| # Image used is https://hub.docker.com/_/mongo/ | |
| docker pull mongo | |
| docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth | |
| # Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception) | |
| # add a root user |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent| // For Yoast SEO Plugin Version: 14.1+ add to your Wordpress Theme's functions.php... | |
| // Remove All Yoast HTML Comments | |
| // https://gist.github.com/paulcollett/4c81c4f6eb85334ba076 | |
| // Credit @devendrabhandari (https://gist.github.com/paulcollett/4c81c4f6eb85334ba076#gistcomment-3303423) | |
| add_filter( 'wpseo_debug_markers', '__return_false' ); | |
| // For Yoast SEO Plugin Version: < 14.1 add to your Wordpress Theme's functions.php... |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| #### this is the main config file for nginx, to specify it from the command line, use the -c switch, e.g | |
| #### nginx.exe -c nginx-railo.conf | |
| ##** if connecting to Tomcat, use Tomcat's RemoteIpValve to resolve CGI.REMOTE_ADDR, CGI.SERVER_NAME, and CGI.SERVER_PORT_SECURE | |
| ##** <Valve className="org.apache.catalina.valves.RemoteIpValve" protocolHeader="X-Forwarded-Proto" remoteIpHeader="X-Forwarded-For" protocolHeaderHttpsValue="https" /> | |
| #user nobody; | |
| #pid logs/nginx.pid; |