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
// Usage: Copy this code and run in a ES6 capable Browser Console | |
function profitFrom({ sell, buy }) { | |
const profit = sell - buy; | |
return (100 * profit / buy) + '%'; | |
} | |
console.log(`${profitFrom({ buy: 50, sell: 50 }) === '0%' && 'PASSED' || 'FAILED'}: No profit or loss for break even`); | |
console.log(`${profitFrom({ buy: 50, sell: 100 }) === '100%' && 'PASSED' || 'FAILED'}: Profit`); | |
console.log(`${profitFrom({ buy: 100, sell: 50 }) === '-50%' && 'PASSED' || 'FAILED'}: Loss`); |
import requests | |
from bs4 import BeautifulSoup | |
import time | |
USER_AGENT = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'} | |
def fetch_results(search_term, number_results, language_code): | |
assert isinstance(search_term, str), 'Search term must be a string' | |
assert isinstance(number_results, int), 'Number of results must be an integer' |
// package.json | |
{ | |
"dependencies": { | |
"web3": "0.17.0-alpha", | |
"solc": "^0.4.4" | |
} | |
} | |
// HelloWorld.sol | |
contract HelloWorld { |
// Infura | |
http://infura.io | |
// BlockCypher | |
http://blockcypher.com |
// To learn more about the halting problem check out Gary Bernhardt's series on computation | |
https://www.destroyallsoftware.com/screencasts | |
// Ethereum Yellow Paper | |
http://gavwood.com/paper.pdf | |
// Ethereum OpCodes List | |
http://ethereum.stackexchange.com/questions/119/what-opcodes-are-available-for-the-ethereum-evm | |
// Ethereum OpCodes Gas Costs |
// package.json | |
{ | |
"dependencies": { | |
"web3": "0.17.0-alpha", | |
"ethereumjs-util": "4.5.0" | |
} | |
} | |
// keypairs.js | |
var EthUtil = require("ethereumjs-util") |
// AlwaysBCoding Screencast - Introduction to AWS EC2 | |
https://www.youtube.com/watch?v=jFBbcleSPoY | |
// Create a new EC2 Instance on aws.amazon.com (Amazon Linux AMI) | |
// ===================== | |
// edit permissions on pem file | |
chmod 400 {keyfile}.pem | |
// ssh into instance, while exposing remote port for remote Atom |
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |
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:
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.