Skip to content

Instantly share code, notes, and snippets.

View beatleboy501's full-sized avatar

Andrew Allison beatleboy501

View GitHub Profile
@beatleboy501
beatleboy501 / SiteNavigation.css
Created September 27, 2022 14:43
react navigation Site Navigation css
.SiteNavigation {
height: 100%;
width: 100%;
display: flex;
flex-direction: column !important;
}
.SiteNavigation .top {
width: 100%;
min-height: 56px;
@beatleboy501
beatleboy501 / App.css
Created September 27, 2022 14:39
react navigation app css
.App {
text-align: center;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
@beatleboy501
beatleboy501 / index.css
Created September 27, 2022 14:38
react navigation index css
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
import React from "react";
import TreeView from "@material-ui/lab/TreeView";
import ExpandMoreIcon from "@material-ui/icons/ExpandMore";
import ChevronRightIcon from "@material-ui/icons/ChevronRight";
import TreeItem from "@material-ui/lab/TreeItem";
import TreeNode from "./TreeNode";
const mockApiCall = async () => {
return new Promise((resolve) => {
setTimeout(() => {
@beatleboy501
beatleboy501 / TreeNode.js
Created July 5, 2022 18:43
Tree Node (Graph) Data Structure
export default class TreeNode {
constructor(props) {
this.root = props.root;
this.id = props.id;
this.name = props.name;
this.children = props.children || [];
}
traverse(callback) {
function goThrough(node) {
@beatleboy501
beatleboy501 / getCognitoUsers.js
Created April 19, 2022 03:10
getCognitoUsers.js
var AWS = require('aws-sdk');
exports.handler = async(event) = > {
const users = await getUsers(event)
const response = {
statusCode: 200,
headers: {
"Access-Control-Allow-Origin": "*"
},
body: JSON.stringify(users),
@beatleboy501
beatleboy501 / create_bracket.py
Last active January 17, 2025 23:03
create_rounds gist
import math
def create_rounds(users, bracketId):
round_names = ['Final', 'Semifinal', 'Quarterfinal', '1/8 Final', '1/16 Final', '1/32 Final', '1/64 Final']
def divide_users(arr, depth, max_depth):
if len(arr) < 2:
return
complement = 2 ** (depth + 2) + 1
if complement - arr[0] <= max_depth:
@beatleboy501
beatleboy501 / command.sh
Created April 1, 2022 19:21
cli command add remote origin for codecommit
git remote add codecommit https://git-codecommit.<YOUR AWS REGION ID>.amazonaws.com/v1/repos/PingPongBrackets
@beatleboy501
beatleboy501 / buildspec.yml
Last active April 1, 2022 19:18
buildspec for ping pong brackets
version: 0.1
phases:
pre_build:
commands:
- echo Installing source NPM dependencies...
- npm install
build:
commands:
- echo Build started on `date`
- npm run build
@beatleboy501
beatleboy501 / findContigSequence.js
Created November 15, 2021 20:30
Find Contiguous Sequence
function findContigSequence(inputArr, target) {
let output = false;
for (let i = 0; i < inputArr.length; i++) { // iterate each item in arr
const currentVal = inputArr[i];
if (currentVal === target) {
output = true; // return true if any item is equal to target
return;
} else {
let nextIndex = i + 1; // inspect the next value in the array
let sum = currentVal; // keep track of sums