Skip to content

Instantly share code, notes, and snippets.

View Jwing28's full-sized avatar
🎯
Focusing

Jonathan Lee Jwing28

🎯
Focusing
  • Chicago, IL
View GitHub Profile
@Jwing28
Jwing28 / README-Template.md
Created May 24, 2018 22:20 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Jwing28
Jwing28 / vanilla-js-cheatsheet.md
Created December 2, 2017 03:05 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@Jwing28
Jwing28 / The Technical Interview Cheat Sheet.md
Created November 15, 2017 07:31 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
// - - - Pre Order - - -
const PreOrder = (tree, cb) => {
cb(tree.val);
if (tree.left) {
PreOrder(tree.left, cb);
}
if (tree.right) {
PreOrder(tree.right, cb);
@Jwing28
Jwing28 / permute.js
Created October 25, 2017 05:29
permutation
var permute = function(nums) {
nums = nums.join("").split(""); //convert to strings so you can concat values
var counter = 0;
var rounds = nums.length;
var fixed;
var result = [];
function recurse(nums,counter,rounds) {
if(rounds) {
rounds--;
@Jwing28
Jwing28 / bst.js
Created October 17, 2017 02:00
ConvertBST
//all nodes to the right and above current can be added to the value of the current node
//***How can I think about this? I try thinking about it visually and it's very slow to draw out the call stack
//is there a more effective way ? Often I get lost in the call stack.
var sum = 0;
var convertBST = function(root) {
if(root === null) return null;
convertBST(root.right);
root.val += sum;
@Jwing28
Jwing28 / LongestPalindrome.js
Created October 12, 2017 22:28
Longest Palindrome
//create freq obj for each letter, iterate over
//if even, increment a counter of its value
//if odd > 1, increment counter value - 1
//if odd = 1, dont count it.
//at end you can add 1 to account for letters that have freq of one. (create variable for this)
//can only happen once (assuming letter w/ freq of 1 exists.)
//ex's. '' - 0, abc - 1, abbc - 3, aaabb - 5, zzz - 3, aaabbcde- 5
var longestPalindrome = function(s) {
var freq = {}, longest = 0, hasOdd = false;
@Jwing28
Jwing28 / code.js
Last active October 10, 2017 02:05
LeetCode: Find the difference
/*
The first solution I thought of was:
turn both strings into arrays
sort both strings (js native sort method)
loop through the arrays
when the letters aren't equal return the letter in the t array
or if they're all equal return the letter at the end
But using the sort method means the time complexity at worst > O(n).
@Jwing28
Jwing28 / comparison.md
Created May 25, 2016 03:28 — forked from makmanalp/comparison.md
Angular vs Backbone vs React vs Ember notes

Note: these are pretty rough notes I made for my team on the fly as I was reading through some pages. Some could be mildly inaccurate but hopefully not terribly so. I might resort to convenient fiction & simplification sometimes.

My top contenders, mostly based on popularity / community etc:

  • Angular
  • Backbone
  • React
  • Ember

Mostly about MVC (or derivatives, MVP / MVVM).

@Jwing28
Jwing28 / index.html
Created September 28, 2015 23:47 — forked from anonymous/index.html
Bill Starr 5x5: Modified // source http://jsbin.com/woyoci
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Bill Starr 5x5: Modified</title>
<link href="CSS/BillStarr.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Montserrat:700' rel=
'stylesheet' type='text/css'>
<style id="jsbin-css">
.banner {