This file contains 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
var AWS = require('aws-sdk'); | |
AWS.config.update({ region: 'your-region-ie:eu-central-1' }); | |
var mysql = require('mysql'); | |
// Better to use environment variables, but for the example we'll leave it like this | |
var dbClusterIdentifier = 'your-cluster'; | |
var clusterEndpoint = 'your-cluster.cluster-identifier.your-region.rds.amazonaws.com'; | |
var user = 'username'; | |
var password = 'password'; |
This file contains 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
import { useState } from "react"; | |
const Home = () => { | |
// let name = 'mario'; | |
const [name, setName] = useState('mario'); | |
const handleClick = (e) => { | |
setName('luiji'); | |
} |
This file contains 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 para = document.querySelector('p'); | |
// para.innerText += 'ninjas are awesome'; | |
// console.log(para.innerText); | |
const paras = document.querySelectorAll('p'); |
This file contains 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 para = document.querySelector('p'); | |
// para.innerText += 'ninjas are awesome'; | |
// console.log(para.innerText); | |
const paras = document.querySelectorAll('p'); |
This file contains 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
//primitive data types are store in a stack, reference data types are stored in a heap | |
//explanation - the data type created is a list, key pair data type | |
//for both the variables, a single value is stored in the heap, changing any one variable | |
// would change the value for both variables, unlike primitive data types, number, string, | |
// booolean |
This file contains 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
let user = { | |
name: 'crystel', | |
age: 30, | |
email: '[email protected]', | |
location: 'berlin', | |
blogs: [ | |
{ title: 'why mac and cheese rules', likes: 30}, | |
{ title: '10 things to make with marmite', likes: 40}, | |
], |
This file contains 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
//arrow functions DO NOT WORK inside an object, if arrow function is user the window context is set for that method | |
let user = { | |
name: 'crystel', | |
age: 30, | |
email: '[email protected]', | |
location: 'berlin', | |
blogs: ['why mac and cheese rules', ['10 things to make with marmite']], | |
login: function(){ | |
console.log('user logged in'); |
This file contains 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
//arrow functions DO NOT WORK inside an object, if arrow function is user the window context is set for that method | |
let user = { | |
name: 'crystel', | |
age: 30, | |
email: '[email protected]', | |
location: 'berlin', | |
blogs: ['why mac and cheese rules', ['10 things to make with marmite']], | |
login: function(){ | |
console.log('user logged in'); |
This file contains 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
let user = { | |
name: 'crystel', | |
age: 30, | |
email: '[email protected]', | |
location: 'berlin', | |
blogs: ['why mac and cheese rules', ['10 things to make with marmite']], | |
login: function(){ | |
console.log('user logged in'); | |
}, | |
logout: function(){ |
This file contains 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
""" | |
Python Data Structures - A Game-Based Approach | |
Reading a maze from a text file | |
Robin Andrews - https://compucademy.net/ | |
""" | |
def read_maze(file_name): | |
""" | |
Reads a maze stored in a text file and returns a 2d list containing the maze representation. |
NewerOlder