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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.31; | |
| contract Activity_5 { | |
| /** | |
| Activity 1 | |
| Create a fixed-size array of length 3 called favoriteNumbers. | |
| Add a function setNumber(uint index, uint value) that updates a number at a given index. | |
| Add another function getNumber(uint index) that returns the value at that index. |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.31; | |
| contract Activity_4 { | |
| /** | |
| Temperature Checker | |
| Make a function that will tell if the temperature is freezing point or boiling point. | |
| Grade Evaluator | |
| Make a function that will return a grade based on a score. | |
| 90 and above → “A” |
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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.31; | |
| contract Activity_3 { | |
| // Celsius to Fahrenheit Converter - Make a function that will convert Celsius to Fahrenheit. | |
| function celsiusToFahrenheit(uint celsius) public pure returns (uint256) { | |
| return (celsius * 9/5) + 32; | |
| } | |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.4.22 <0.9.0; | |
| library TestsAccounts { | |
| function getAccount(uint index) pure public returns (address) { | |
| address[15] memory accounts; | |
| accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4; | |
| accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2; |
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
| /** | |
| * Boolean | |
| * | |
| * The most basic datatype is the simple true/false value, | |
| * which JavaScript and TypeScript (as well as other languages) call a 'boolean' value. | |
| */ | |
| var isDone: boolean = false; | |
| /** | |
| * Number |
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 XLSX = require('xlsx') | |
| const path = require('path') | |
| const fs = require('fs') | |
| const file = path.join(__dirname, '/rental_units.xlsx') | |
| fs.readFile(file, (err, data) => { | |
| var wb = XLSX.readFile(file) | |
| /* generate array of arrays */ | |
| data = XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]], { header: 1 }) |
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
| Object.defineProperty(Array.prototype, "first", { | |
| get: function() { | |
| return this[0]; | |
| } | |
| }); | |
| Object.defineProperty(Array.prototype, "last", { | |
| get: function() { | |
| return this[this.length - 1]; | |
| } |
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
| 'use strict'; | |
| import { v1 as neo4j } from 'neo4j-driver'; | |
| import crypto from 'crypto'; | |
| import uuidv4 from 'uuid/v4'; | |
| import middleware from 'lambda-utilities/lib/middleware'; | |
| import { filterWarmUpEvent } from 'lambda-utilities/lib/middleware/filterWarmUpEvent'; | |
| import { ErrorUnauthorized } from 'lambda-utilities/lib/error'; | |
| import { jsonResponse } from '../utils/util'; | |
| import errorResponse from '../utils/errorResponse'; |
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
| 'use strict'; | |
| import middleware from 'lambda-utilities/lib/middleware'; | |
| import { filterWarmUpEvent } from 'lambda-utilities/lib/middleware/filterWarmUpEvent'; | |
| import { ErrorUnauthorized } from 'lambda-utilities/lib/error'; | |
| import { | |
| jsonResponse, | |
| getMidNight, | |
| getBeforeMidNight, | |
| getNextDay, |
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
| // images are from the properties.. | |
| downloadImages = async ({ images }) => { | |
| const newImage = images.map(image => { | |
| return RNFetchBlob.fetch('GET', image.url) | |
| .then(res => { | |
| return { | |
| title_en: image.title_en, | |
| type: image.type, | |
| image: `data:image/png;base64,${res.base64()}`, |
NewerOlder