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 program converts a floating point number from binary to decimal | |
# sign mantissa * 2**(exponent) | |
sign = 0 | |
exponent = '10100' | |
mantissa = '0110101110' | |
# convert binary to decimal | |
def bin2dec(n): |
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
########## | |
# GitHub # | |
########## | |
GitHub's APIs are AWESOME! They give you access to soooo much information, it's insane! | |
Nearly everything you want to know you can access via their APIs. | |
This includes things like: name, username, profile picture, repos, *email*, user events, *followers/following*, etc. | |
The main practical restrictions come from the API rate limiting. | |
Unauthenticated requests (what I used in my project) are limited to something like 50 requests per IP per hour. |
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
/** | |
* Wrapper for setTimeout | |
* @param {number} timeDelay Time to wait (ms) | |
* @returns {promise} Empty promise that is resolved after the delay | |
*/ | |
async function wait(timeDelay){ | |
return new Promise( | |
resolve => setTimeout( | |
() => resolve(), timeDelay | |
) |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Home</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
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
// install git-bash | |
https://git-scm.com/downloads | |
// Sign up with Github | |
https://github.com/join |
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
Go to github.com and create a new repository named "final-project" (https://github.com/new) | |
Clone your final-project repository using SSH | |
Add the following to your final-project folder | |
Folders: | |
about | |
contact | |
css |
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
// new react app | |
npx create-react-app | |
// install sass | |
npm install node-sass --save | |
// install react router | |
npm install react-router | |
// install gh-pages https://dev.to/yuribenjamin/how-to-deploy-react-app-in-github-pages-2a1f |
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
# https://renzolucioni.com/verifying-jwts-with-jwks-and-pyjwt/ | |
import jwt | |
import json | |
import urllib.request | |
# config | |
region = '' | |
userpoolID = '' |
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
const data = { | |
a:{ | |
b:{ | |
c:{"neat":"right!?"} | |
} | |
} | |
} | |
function getDataAtPath(path, currentData){ |