MD file cheatsheet -
md-cheatSheet
Keyboard Shortcuts Windows -
ShortcutsWindows
Keyboard Shortcuts Mac -
Keyboard Shotcuts Mac
Git -
oh-my-git
git-branches
Flexbox -
flexbox-froggy
flex-box-zombie
tower-defense
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
#These are the basics of python | |
#create a variable | |
#*******variable types in Python***** | |
string = "Hello World" #string | |
integer= 20 #int | |
a_float = 20.5 #float | |
complex_variable = 1j #complex | |
a_list = ["apple", "banana", "cherry"] #list | |
tuple_list = ("apple", "banana", "cherry") #tuple (cant have repeating elements) | |
a_range = range(4,6) #range is a method that gives a range of nums starting at 0 or with two arguments (inclusive) |
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
--*************************** BASIC QUERIES **************************** | |
--Find all employees | |
SELECT * | |
FROM employee; | |
--find all clients | |
SELECT * | |
FROM client; | |
--Find all employees ordered by salary | |
SELECT * |
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
--***********************EMPLOYEE TABLE ************************** | |
--This creates the employee table but the super_id and branch_id are going to be forgein keys later. | |
CREATE TABLE employee( | |
emp_id INT PRIMARY kEY AUTO_INCREMENT, | |
first_name VARCHAR(40), | |
last_name VARCHAR(40), | |
birth_date DATE, | |
sex VARCHAR(1), | |
salary INT, | |
super_id INT, |
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
--TABLE CREATION OR MODIFICATION | |
-- ************************************************** | |
--Creates a new table with three columns, student_id being the primary key | |
--INT is interger, VARCHAR is string and the 2 is up to 20 in length | |
--NOT NULL means that this value cannot be null or undefined | |
--UNIQUE means it has to be unique | |
--AUTO_INCREMENT means the student id will keep counting base on the last entry | |
CREATE TABLE student ( | |
student_id INT PRIMARY KEY AUTO_INCREMENT, | |
name VARCHAR(20) NOT NULL, |
Go to this link https://cloudinary.com/ and create your cloudinary account, verify your email and go through or skip the initial questions
After you are done you should be able to see the following in your dashboard:
- Cloud Name
- API key
- API Secret
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
function filter_list(l) { | |
return l.filter((elem)=> typeof elem === 'number') | |
} |
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
class Chronometer { | |
constructor() { | |
this.currentTime = 0; | |
this.intervalId = null; | |
} | |
start(printTimeCallback) { | |
this.intervalId = setInterval(() => { | |
this.currentTime += 1; | |
if (printTimeCallback) { |
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
// Iteration 1: All directors? - Get the array of all directors. | |
// _Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors. | |
// How could you "clean" a bit this array and make it unified (without duplicates)? | |
function getAllDirectors(moviesArray) { | |
const directorsArr = moviesArray.map((oneMovie) => { | |
return oneMovie.director; | |
}); | |
return directorsArr; | |
} |
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
// Soldier | |
class Soldier { | |
constructor(health, strength) { | |
this.health = health; | |
this.strength = strength; | |
} | |
attack() { | |
return this.strength; | |
} | |
receiveDamage(damage) { |
NewerOlder