Skip to content

Instantly share code, notes, and snippets.

View renso3x's full-sized avatar
🎯
Focusing

Renso3x renso3x

🎯
Focusing
View GitHub Profile
// 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.
// 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”
@renso3x
renso3x / Activity_3.sol
Created March 4, 2026 03:40
Activity Three
// 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;
}
@renso3x
renso3x / .deps...remix-tests...remix_accounts.sol
Created January 10, 2023 05:17
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// 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;
@renso3x
renso3x / 01: basic types.ts
Created November 21, 2019 03:47 — forked from dimitardanailov/01: basic types.ts
Typescript in action
/**
* 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
@renso3x
renso3x / csvParser.js
Created October 18, 2019 08:10
excel parser
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 })
Object.defineProperty(Array.prototype, "first", {
get: function() {
return this[0];
}
});
Object.defineProperty(Array.prototype, "last", {
get: function() {
return this[this.length - 1];
}
'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';
@renso3x
renso3x / lambda.js
Created May 6, 2019 10:41
lambda.js
'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,
// 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()}`,