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
| def sort(arr): | |
| arrLen = len(arr) | |
| times_sorted = 0 | |
| for _ in range(arrLen): | |
| for i in range(arrLen - times_sorted): | |
| if i < arrLen-1: | |
| if arr[i] > arr[i+1]: | |
| a = arr[i] | |
| b = arr[i+1] | |
| arr[i] = b |
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
| export const quadraticFormula = (a,b,c) => ([ | |
| ((-b)+Math.sqrt((b)**2-(4*a*c)))/(2*a), | |
| ((-b)-Math.sqrt((b)**2-(4*a*c)))/(2*a) | |
| ]); |
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 express = require('express'); | |
| const app = express(); | |
| const PORT = process.env.PORT || 8080; | |
| app.set('views', __dirname + '/views'); | |
| app.set('view engine', 'jsx'); | |
| app.engine('jsx', require('express-react-views').createEngine()); | |
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 React = require('react'); | |
| function Index(props) { | |
| return <h1>Hello {props.name}!</h1>; | |
| } | |
| export default Index; |
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
| <div class="scoreboard"> | |
| <div class="score away"> | |
| <h3>14</h3> | |
| <h5>Patriots</h5> | |
| </div> | |
| <div class="timeAndQuarter"> | |
| <h2>4th</h2> | |
| <h3>4:43</h3> | |
| </div> |
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
| let scrollBarHeight; | |
| // ONLY RUN WHEN SCROLLED TO BOTTOM | |
| window.scrollBarHeight = (document.querySelector("#messages").scrollHeight) - ($("#messages").height() + $("#messages").scrollTop()); | |
| // END OF ONLY RUN WHEN SCROLLED TO BOTTOM | |
| $("#messages").scroll(() => { | |
| const a = document.querySelector("#messages").scrollHeight; | |
| const b = $("#messages").height() * 2; | |
| const c = $("#messages").height() - $("#messages").scrollTop(); |
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 sys | |
| import random | |
| def generate_password(length, no_symbols=False): | |
| chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
| if not no_symbols: | |
| chars += '~!@#$%^&*()_-+={[}]|:;<,>.?/' |