Skip to content

Instantly share code, notes, and snippets.

View aaronvegu's full-sized avatar
🐢
Coding

Aaron Vegu aaronvegu

🐢
Coding
View GitHub Profile
@aaronvegu
aaronvegu / Introducción a JavaScript: Valores y Declaraciones.md
Created April 24, 2020 16:52
Notas de introducción a los valores básicos utilizados en JavaScript y las expresiones mas comunes en el lenguaje

Valores

Valores Primitivos

// Numeros
	40
// String
	"Aaron Vegu"
// Booleanos
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
import 'https://raw.githubusercontent.com/provable-things/ethereum-api/master/provableAPI_0.6.sol';
contract ETHUSD is usingProvable {
// Variable que guardara nuestra relacion entre las divisas
uint256 public etherUSD;
// Constructor
@aaronvegu
aaronvegu / Enabling_ES6_Modules.md
Created October 29, 2020 00:55
Enable use of ES6 Modules on NodeJS

How to enable the use of ES6 Modules on NodeJS

The first thing is to have a new version of NodeJS up to 14.x

Then you need to go to your package.json file of your project, and add the line:

 "type": "module"

It can be just after your main or description attribute, like this:

@aaronvegu
aaronvegu / Use_of_Concurrently.md
Created October 29, 2020 01:24
How to use concurrently and nodemon to run two different ports when developing a node application. In this case we need to run port 5000 for our backend express server and port 3000 for the react frontend in order to run our MERN Stack app.

How to use concurrently and nodemon to run multiple commands from start back and front services on a MERN Application

Install Concurrently and Nodemon

We need to install both as dev dependencies in our project:

npm i -D concurrently
npm i -D nodemon

ReduxJS

Is a state management tool build on js that help us to manage global states that works and interacts with diferents components in our app. The first thing to remember - or know- is that Redux is not exclusively for React, it can be used for Angular or any other technology, is just that is used commonly with React.

Installing Dependencies

If we are writing a full stack app we might want go to our frontend folder before we install the following dependencies (with NPM):

@aaronvegu
aaronvegu / Avathers.sol
Created November 16, 2020 03:43
1st Version of a smart contract for Avathers project. Written in solidity.
// SPDX-License-Identifier: MIT
pragma solidity 0.6.2;
// IMPORTS
// Importamos solo la interfaz del ERC721
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
// El Receiver nos ayuda a ser compatibles con el ERC165 y tambien poder recibirlo
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
// Importamos el contrato ERC165, ya que lo requiere el ERC721
@aaronvegu
aaronvegu / Accesing the Process Object [NODE].md
Created November 28, 2020 22:10
Exercise to learn the basics of the Process Object on NodeJS. Take it from a Codecademy lesson.

Accessing the Process Object

In computer science, a process is the instance of a computer program that is being executed. You can open Task Manager if you’re on a Windows machine or Activity Monitor from a Mac to see information about the various processes running on your computer right now. Node has a global process object with useful methods and information about the current process.

The process.env property is an object which stores and controls information about the environment in which the process is currently running. For example, the process.env object contains a PWD property which holds a string with the directory in which the current process is located. It can be useful to have some if/else logic in a program depending on the current environment— a web application in a development phase might perform different tasks than when it’s live to users. We could store this information on the process.env. One convention is to add a property to process.env with the key NODE_ENV and a value of either produ

let target;
const humanGuessInput = document.getElementById('human-guess');
const roundNumberDisplay = document.getElementById('round-number');
const computerGuessDisplay = document.getElementById('computer-guess');
const humanScoreDisplay = document.getElementById('human-score');
const computerScoreDisplay = document.getElementById('computer-score');
const targetNumberDisplay = document.getElementById('target-number');
let input = 'I like turtles!'
const vowels = ['a', 'e', 'i', 'o', 'u']
let resultArray = []
let word = ''
for (let i = 0; i < input.length; i++) {
for (let j = 0; j < vowels.length; j++) {
// Exercise taken from Codecademy Pro to understand Object Sintax.
/**
* As a frequent diner, you love trying out new restaurants and experimenting with different foods.
* However, having to figure out what you want to order can be a time-consuming ordeal if the menu is big,
* and you want an easier way to be able to figure out what you are going to eat.
* In this project, you’ll use JavaScript to randomly create a three-course meal based on what is available on a menu.
* We’ll keep running it until we’re satisfied with the generated meal!
*/
const menu = {