Skip to content

Instantly share code, notes, and snippets.

View robgmerrill's full-sized avatar

Rob Merrill robgmerrill

View GitHub Profile
@robgmerrill
robgmerrill / FodU-11.js
Last active February 18, 2017 15:50
Add to Head Method on Linked list
// linked list constructor function
function LinkedList() {
// initial creation has no nodes
this.head = null;
this.tail = null;
}
// node constructor function
// properties value, next previous
function Node(value, next, prev) {
@robgmerrill
robgmerrill / FodU-19.js
Last active February 18, 2017 16:16
Linked List add to head/tail by robgmerrill - https://repl.it/FodU/19
// linked list constructor function
function LinkedList() {
// initial creation has no nodes
this.head = null;
this.tail = null;
}
// node constructor function
// properties value, next previous
function Node(value, next, prev) {
@robgmerrill
robgmerrill / FodU-36.js
Created February 19, 2017 16:00
Linked List with Search Method by robgmerrill - https://repl.it/FodU/36
// linked list constructor function
function LinkedList() {
// initial creation has no nodes
this.head = null;
this.tail = null;
}
// node constructor function
// properties value, next previous
function Node(value, next, prev) {
@robgmerrill
robgmerrill / FpSK-8.js
Created February 19, 2017 16:53
Hash Table Insert by robgmerrill - https://repl.it/FpSK/8
// Hash Table
// key value pairs
// {key: name, value: number}
// constructor function for the table and consturctor function for the node
function HashTable(size) {
// make a new array of size of choice and assign it to property of buckets
this.buckets = Array(size);
this.numBuckets = this.buckets.length;
}
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@robgmerrill
robgmerrill / index.html
Last active August 2, 2018 14:27
Reverse a String - Approach 1 - Built in Methods
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@robgmerrill
robgmerrill / caesar-cipher.cs
Created October 28, 2019 21:53
Caesar Cipher
using System;
namespace CaesarCipher
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter your secret message: ");
string input = Console.ReadLine();
@robgmerrill
robgmerrill / prime-directive.java
Created January 22, 2020 19:51
Prime Directive
// some other stuff
import java.util.ArrayList;
class PrimeDirective {
public boolean isPrime(int number) {
if (number == 2) {
return true;
} else if (number < 2) {