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
// React State | |
const [fileView, setFileView] = useState('SELECTED'); | |
// this is our onChange handler | |
const toggleAll = e => { | |
setFileView(e.target.value); | |
}; | |
// JSX | |
<header className="files-toggle"> |
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
"workbench.colorTheme": "Night Owl", | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.detectIndentation": false, | |
"editor.wordWrap": "on", | |
"editor.fontSize": 14, | |
"editor.lineHeight": 23, | |
"workbench.editor.tabSizing": "shrink", | |
"files.trimTrailingWhitespace": true, | |
"editor.fontWeight": "100", |
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 searchbar = document.querySelector('#searchbar'); | |
var searchButton = document.querySelector('#search'); | |
var results = document.querySelector('.results'); | |
var userInput = searchbar.value; | |
function fetchData() { | |
fetch( | |
'https://en.wikipedia.org/w/api.php?action=query&format=json&generator=search&gsrlimit=10&prop=extracts&pilimit=max&exintro&explaintext&exsentences=2&exlimit=max&gsrsearch=' + | |
userInput |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Local Weather Viewer</title> | |
<link rel="stylesheet" href="assets/style.css"> | |
</head> |
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 getPosition() { | |
if (navigator.geolocation) { | |
// store location | |
navigator.geolocation.getCurrentPosition(fetchData); | |
console.log('Location Available'); | |
} else { | |
// no location | |
console.log('No Location Available'); | |
} | |
} |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
int main(int argc, string argv[]) { | |
if (argc != 2) { | |
printf("Error, try again"); |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
int main(void) | |
{ | |
// prompt user for name | |
printf("What is your name? "); |
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
#include <cs50.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <ctype.h> | |
int main(void) | |
{ | |
// prompt user for name | |
printf("What is your name? "); |