Skip to content

Instantly share code, notes, and snippets.

View JayMcConnon's full-sized avatar

James McConnon JayMcConnon

  • Plymouth, Uk
View GitHub Profile
@JayMcConnon
JayMcConnon / BinaryTree.js
Last active July 6, 2020 19:56
Binary Tree with search by value, insert and depthFirstTraversal
class BinaryTree {
constructor(value, depth = 1) {
this.value = value;
this.depth = depth;
this.left = null;
this.right = null;
}
insert(value) {
if (value < this.value) {
@JayMcConnon
JayMcConnon / BS.js
Created July 6, 2020 11:05
sample binary search
const binarySearch = (arr, target) => {
let left = 0;
let right = arr.length;
while (right > left) {
const indexToCheck = Math.floor((left + right) / 2);
const checking = arr[indexToCheck];
console.log(`indexToCheck equals: ${indexToCheck}`)
if (checking === target) {
const Node = require('./Node');
class DoublyLinkedList {
constructor() {
this.head = null;
this.tail = null;
}
addToHead(data) {
const newHead = new Node(data);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Test Gist</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@JayMcConnon
JayMcConnon / index.html
Last active October 6, 2016 01:09
bootstrap CDN example
<title>Bootstrap inline example</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
You have working bootstrap on this page!
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
@JayMcConnon
JayMcConnon / index.html
Last active October 7, 2016 20:42
Codepen test
<?php
<div class="container info-container">
<h1>An example of An embedded code editor with preview!</h1>
<p>The ultimate way to show off your prowess and knowledge to your customers through guides and blog posts.</p>
<p>This is all loaded from a Github gist <a href="https://gist.github.com/JayLancaster/fe6c5f18002913a98b7da1e49066cdf6/" target="_blank">Here</a></p>
<p>Ceejay asked me to write this in to prove it works Kappa</p>
<p><img src="http://forums.euw.leagueoflegends.com/board/attachment.php?attachmentid=190396"></p>
<h1>You literally cannot get better than this</h1>
@JayMcConnon
JayMcConnon / gist:047d0aff228a2ee2da559568cd161687
Last active October 3, 2016 19:38
A test blog post gist!

An h1 header

Paragraphs are separated by a blank line.

2nd paragraph. Italic, bold, and monospace. Itemized lists look like:

  • this one
  • that one
@JayMcConnon
JayMcConnon / blog.md
Created September 9, 2016 23:12
My test blog!

Test post!