Skip to content

Instantly share code, notes, and snippets.

View TechWithTy's full-sized avatar
🎯
Focusing

TechWIthTy TechWithTy

🎯
Focusing
View GitHub Profile
@TechWithTy
TechWithTy / Two Sum.js
Created September 27, 2020 02:49
LeetCode Two Sum Problem
/**
* @param {number[]} nums
* @param {number} target
* @return {number[]}
*/
var twoSum = function(nums, target) {
previousValues = {}; // Set Previous Hash Values
for (let i = 0; i < nums.length; i++){ // Loop through entire array
currentNum = nums[i]; // Get Current Loop Number
neededNum = target - currentNum; //Calculate Number Needed
@TechWithTy
TechWithTy / Linked List Tests
Created September 20, 2020 23:59
Linked List Tests with Jest
const LinkedList = require('./LinkedList')
describe('#insertAtHead', () => {
test('it adds the element to the beginning of the list', () => {
const ll = new LinkedList()
ll.insertAtHead(10)
const oldHead = ll.head
ll.insertAtHead(20)
expect(ll.head.value).toBe(20)
@TechWithTy
TechWithTy / Linked List Javascript
Created September 20, 2020 23:58
Linked List Javascript
// Linked List
class LinkedList {
constructor() {
this.head = null
this.length = 0
}
insertAtHead(data) {
const newNode = new LinkedListNode(data, this.head)
this.head = newNode
@TechWithTy
TechWithTy / Entire Log
Created May 31, 2020 19:25
Entire Log For Build Problem
$ npm run build
> genius-course-react@1.0.0 build C:\Users\13054\Documents\GitHub\Responsive_Renovations_LLC\ResponsiveRenovations
> webpack --mode production
[BABEL] Note: The code generator has deoptimised the styling of C:\Users\13054\Documents\GitHub\Responsive_Renovations_LLC\ResponsiveRenovations\src\assets\js\jquery-ui.js as it exceeds the max of 500KB.
Hash: bdbfd98ea836b854801c
Version: webpack 4.41.5
Time: 137586ms
Built at: 05/31/2020 1:22:20 PM
@TechWithTy
TechWithTy / StackOverFlow Build Problem
Created May 31, 2020 19:24
StackOverFlow Build Problem
//WebPack File
const HtmlWebPackPlugin = require('html-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const webpack = require('webpack');
// const outputPath = path.join(__dirname, "dist");
const extractSass = new ExtractTextPlugin({
filename: '[name].[hash].css',
disable: process.env.NODE_ENV === 'development',
});
from appium import webdriver
from self import self
app = r"C:\Users\13054\Downloads\New folder\\Shopper4.181.2-p_418102.apk"
@TechWithTy
TechWithTy / orderFind
Created September 25, 2019 02:23
Order Login Modal
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import React, { useContext, useEffect, useState } from 'react';
import { withRouter } from 'react-router-dom';
import styled from 'styled-components';
import { ProductContext } from '../context';
const LoginModal = props => {
const [transactionID, settransactionID] = useState(1);
const [orderNum, setorderNum] = useState(1);
import Button from '@material-ui/core/Button';
import Checkbox from '@material-ui/core/Checkbox';
import ExpansionPanel from '@material-ui/core/ExpansionPanel';
import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails';
import ExpansionPanelSummary from '@material-ui/core/ExpansionPanelSummary';
import Paper from '@material-ui/core/Paper';
import { makeStyles } from '@material-ui/core/styles';
import Table from '@material-ui/core/Table';
import TableBody from '@material-ui/core/TableBody';
import TableCell from '@material-ui/core/TableCell';
@TechWithTy
TechWithTy / Jest-Test
Created September 24, 2019 00:54
Jest-Test
import {productionEnv} from './context'
console.log(productionEnv)
const production = true;
test('Production Test', () => {
expect(production).toBeTruthy();
});
@TechWithTy
TechWithTy / SortSocks.js
Created September 15, 2019 01:52
HackerRank Sock Pairs Challenge
function sortAndCount( n, arr ) {
let sorted = arr.sort( (a,b) => a - b);
let pairs = 0;
for (let i = 0; i < n -1 ; i++) {
if ( sorted[i] === sorted[i + 1]) {
pairs++;
i += 1;
}
}