This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http'); | |
| const fs = require('fs'); | |
| function promisify(func) { | |
| // A new function which returns promise | |
| return function (...args) { | |
| return new Promise((resolve, reject) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function promisify(func) { | |
| // A new function which returns promise | |
| return function (...args) { | |
| return new Promise((resolve, reject) => { | |
| // Create our custom callback function which will original function will call | |
| let callback = function (err, response) { | |
| // On recieving callback it will resolve or reject the promise | |
| if (err) return reject(err); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let callback = function (err, response) { | |
| // On recieving callback it will resolve or reject the promise | |
| if (err) return reject(err); | |
| return resolve(response); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function promisify(func) { | |
| // A new function which returns promise | |
| return function (...args) { | |
| return new Promise ((resolve, reject) => { | |
| // Do Some Magic here | |
| }) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http = require('http'); | |
| const fs = require('fs'); | |
| http.createServer(function (req, res) { | |
| let siteDirectory = __dirname + "/site"; | |
| let path = siteDirectory + req.url; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo -n "This is my input string" | openssl dgst -sha256 | |
| //SHA256Hash 6690b2acecf85846cc58aca39034d1de41e5c35d1bb6c28748f8db64a84ce16b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const _ = require('lodash'); | |
| let employee1 = { | |
| name : "Jon", | |
| address : { | |
| street : "North Avenue", | |
| area : "DAC", | |
| zip : "87344", | |
| contact : [ 12444554, 9384847 ] | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ServerName app.mydomain.com | |
| ProxyPreserveHost On | |
| ProxyPass / http://127.0.0.1:4000/ | |
| ProxyPassReverse / http://127.0.0.1:4000/ | |
| </VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <VirtualHost *:80> | |
| ServerName app.mydomain.com | |
| DocumentRoot "/var/www/my-static-website" | |
| ServerAdmin admin@mydomain.com | |
| </VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @cert-authority *.mydomain.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCkFmjQ5s3FwepM6qntdkmpnlTxxaOXsFA2DeTGLzf2OROh649+fk4Ru0/8SMjVB7wx4okOB/xtEohO1xlQ7XfxFElYJtZbt49CIX9EJd/FwYu3qi6WRXNSJp5D54ngmGtnYdOoTYFECNwr2NsRWnXAaIzfIYKY3C59eeOCS3KlFszVsnSMckqsYoiK1GkvwoeOHWdaSamkXXSbAiLwZaH1FCjTBOS7EB/Qi8npeNwVRhI9Bly8Goc47j9aDi28riEj5Fz540EaF4awOzvsxMT1QvRVa6iy5FDnPpMwNkV1XokaILfykhC20uWFp+blysGI0Qrdfl root@ak.local |
NewerOlder