View AguilaCoin.sol
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.4.22 <0.8.0; | |
contract AguilaCoin { | |
uint256 private _totalSupply; | |
mapping (address => uint256) private _balances; | |
mapping (address => mapping (address => uint256)) private _allowed; |
View AccountsDemo.sol
// Code snippet from Blockchain in Action | |
pragma solidity ^0.6.0; | |
contract AccountsDemo { | |
address public whoDeposited; | |
uint public depositAmount; | |
uint public accountBalance; | |
function deposit() public payable { | |
whoDeposited = msg.sender; |
View app.js
// Author: Salvador Guerrero | |
'use strict' | |
const fs = require('fs') | |
const crypto = require('crypto') | |
// Third-Party Modules | |
const {MongoClient, ObjectId} = require('mongodb') | |
const jwt = require('jsonwebtoken') |
View app.js
// Author: Salvador Guerrero | |
'use strict' | |
const fs = require('fs') | |
const crypto = require('crypto') | |
// Project modules | |
const { CreateServer } = require('./server') | |
const SecurityUtils = require('./security-utils') |
View app.js
// Author: Salvador Guerrero | |
'use strict' | |
const fs = require('fs') | |
// Project modules | |
const { CreateServer } = require('./server') | |
const SecurityUtils = require('./security-utils') |
View EncodingUtil.js
// Author: Salvador Guerrero | |
'use strict' | |
// https://nodejs.org/api/zlib.html | |
const zlib = require('zlib') | |
const kGzip = 'gzip' | |
const kDeflate = 'deflate' | |
const kBr = 'br' |
View EncodingUtil.js
// Author: Salvador Guerrero | |
'use strict' | |
// https://nodejs.org/api/zlib.html | |
const zlib = require('zlib') | |
const kGzip = 'gzip' | |
const kDeflate = 'deflate' | |
const kBr = 'br' |
View index.js
// Author: Salvador Guerrero | |
const http = require('http'); | |
const fs = require('fs') | |
// Third-party modules | |
const ftp = require("basic-ftp") | |
var {Base64Encode} = require('base64-stream') | |
let port = 3000 |
View index.js
const http = require('http'); | |
const fs = require('fs') | |
let port = 3000 | |
http.createServer((req, response) => { | |
/** | |
* `/` loads index.html | |
*/ | |
if (req.url == '/' && req.method.toLowerCase() == 'get') { |
View node_playground.js
// I created this script as a playground when learning node.js | |
// The Majority of examples are grabbed from https://nodejs.dev/ | |
/** | |
* Make this server reacheable by the world. | |
* Install ngrok and type `ngrok PORT` and the PORT you want is exposed to the | |
* internet. You will get a ngrok.io domain, but with a paid subscription you | |
* can get a custom URL as well as more security options. | |
* | |
* Another service you can use is https://github.com/localtunnel/localtunnel |
NewerOlder