This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="about-container" id="about-one"> | |
<div class="nav-container"> | |
<a class="nav-link"><%= image_tag "jclogo.png", class: "jclogo"%></a> | |
<nav> | |
<ul> | |
<li><a href="#web-apps">Web Apps</a></li> | |
<li><a href="#blog">Blog</a></li> | |
<li><a href="#tools">Tools</a></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mergeSort = (arr) => { | |
if (arr.length < 2) return arr; | |
const middle = Math.floor(arr.length / 2); | |
const left = arr.slice(0, middle); | |
const right = arr.slice(middle); | |
return merge(mergeSort(left), mergeSort(right)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mergeSort = (arr) => { | |
if (arr.length < 2) return arr; | |
var middle = Math.floor(arr.length / 2); | |
var left = arr.slice(0, middle); | |
var right = arr.slice(middle, arr.length); | |
return merge(mergeSort(left), mergeSort(right)); | |
} | |
merge = (left, right) => { | |
var result = []; | |
while (left.length && right.length) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Image | |
def initialize(array) | |
@array = array | |
@row_length = array.length | |
@col_length = array[0].length | |
end | |
def output_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ // <-- IS THIS NECESSARY IF JS HAS OWN FILE? | |
// The taskHtml method takes in a Jacascript representation | |
// of the task and produces an HTML representation using | |
// <li> tags | |
function taskHtml(task) { | |
var checkedStatus = task.done ? "checked" : ""; | |
var liClass = task.done ? "completed" : ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addElements(arr) { | |
// create an array of the alphabet to find the numerical value of each letter in the input array | |
let alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", | |
"j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", | |
"v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", | |
"H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", | |
"T", "U", "V", "W", "X", "Y", "Z"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findDupsMiss(arr) { | |
let missingNum = []; | |
let newArr = []; | |
arr = arr.sort((a, b) => a - b); | |
let dup = [...new Set(arr)]; | |
for (let y = 1; y < dup.length; y++) { | |
if (dup[y] - dup[y - 1] != 1) missingNum.push(dup[y] - 1) | |
} | |
for (let i = 0; i < arr.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXWZ"; | |
var cipher = "nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXWZABCDEFGHIJKLM"; | |
function rot13(message){ | |
return message.split('').map(function(c) { | |
var i = alphabet.indexOf(c); | |
if (i < 0) { | |
// not in alphabet, return char | |
return c; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rot13(name) { | |
if (name.length === 0) return "Submission cannot be empty."; | |
let alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; | |
let res = []; | |
name = name.toLowerCase().split(""); | |
for (let i = 0; i < name.length; i++) { | |
for (let j = 0; j < alphabet.length; j++) { | |
if (name[i] === alphabet[j]) { | |
if (alphabet[j + 13] === undefined) { | |
res.push(alphabet[j - 13]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WordCounter | |
def self.count(string) | |
return nil if !string || string == "" | |
string = string.downcase.gsub(/[\n.,?()]/, '').split(" ") | |
string.each_with_object(Hash.new(0)) { |word, counts| counts[word] += 1} | |
end | |
end |
NewerOlder