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
This is my Java note from caveofprogramming.com by John. | |
This is not a program. | |
All credit goes to John. | |
/* | |
|---------------------------------------- | |
|Ten tips to make you a better programmer. | |
|---------------------------------------- | |
*/ | |
10. Learn to touch type. | |
9. Name variables and subroutines descriptively |
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
//This is my note for Java Collection Framework course taught by John. | |
//Original credit: John from caveofprogramming.com | |
//All of his videos can be found in youtube.com | |
/**--------------------------------- | |
| 1. ArrayList | |
| | |
*/--------------------------------- | |
1. | |
-ArrayList class implements the class that is expandable. |
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
<script> | |
/* | |
Have the function RunLength(str) take the str parameter being passed | |
and return a compressed version of the string using the Run-length | |
encoding algorithm. This algorithm works by taking the occurrence of | |
each repeating character and outputting that number along with a single | |
character of the repeating sequence. For example: "wwwggopp" would return | |
3w2g1o2p. The string will not contain any numbers, punctuation, or symbols. | |
*/ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Disable Key in JavaScript</title> | |
<script> | |
function noenter(e) { | |
//1. window is an object that represents an open window in a browser. | |
//2. event is an action that can be detected by javascript. | |
//Sometimes we want to execute a JavaScript when an event |
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
//Code for PrivateRoute.js | |
import React from "react"; | |
import { Navigate } from "react-router-dom"; | |
import { useAuth } from "../contexts/AuthContext"; | |
export default function PrivateRoute({ children }) { | |
const { currentUser } = useAuth(); |
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
import { useContext, createContext } from "react"; | |
const moods = { | |
happy: ':)', | |
sad: ':(' | |
}; | |
const MoodContext = createContext(moods); | |
function App() { |
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
import React, { useState } from 'react' | |
export default function Signup() { | |
const people = [{name:'Jamie', age:37, id:1},{name:'Tyrion', age:36, id:2}]; | |
const [users, updateUser] = useState(people); | |
//For Printing in cosole | |
people.map((person)=>{ | |
console.log(person.name) |
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
<?php | |
//This class helps to connect to the | |
class Connection{ | |
public function connect() | |
{ | |
return new PDO('mysql:host=localhost; dbname=sqlinjection2','root','root'); | |
} | |
} |
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
<?php | |
require 'pdo.php'; | |
//1. Create an instance of connection | |
$pdo_obj = new Connection(); | |
//2. Connect to the server + db | |
try |
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
<?php | |
require 'pdo.php'; | |
//1. Create an instance of connection | |
$pdo_obj = new Connection(); | |
//2. Connect to the server + db | |
try |
NewerOlder