diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..4094c71 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore deleted file mode 100644 index cf76c20..0000000 --- a/.gitignore +++ /dev/null @@ -1,132 +0,0 @@ -.DS_Store - -.class - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -.python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ diff --git a/Easy/longest_common_prefix.js b/Easy/longest_common_prefix.js deleted file mode 100644 index 6e8e733..0000000 --- a/Easy/longest_common_prefix.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Write a function to find the longest common prefix - * string amongst an array of strings. - * - * If there is no common prefix, return an empty string "". - * - * Examples: - * 1) Input: strs = ["flower","flow","flight"] - * Output: "fl" - * - * 2) Input: strs = ["dog","racecar","car"] - * Output: "" - * Explanation: There is no common prefix among the input strings. - * - * Constraints: - * 1) 0 <= strs.length <= 200 - * 2) 0 <= strs[i].length <= 200 - * 3) strs[i] consists of only lower-case English letters. - * - * @param {string[]} strs - * @return {string} - */ -var longestCommonPrefix = function(strs) { - if(strs.length < 1) { return ""; } - - let firstWord = strs[0]; - let index = 0; - let prefix = ""; - - for (const character of firstWord) { - for (let i = 1; i < strs.length; i++) { - let word = strs[i]; - let charAtIndex = word[index]; - - if(charAtIndex !== character || index > word.length) - return prefix; - - } - index++; - prefix += character; - } - return prefix; -}; - -console.log(longestCommonPrefix(["flower","flow","flight"])); -console.log(longestCommonPrefix(["dog","racecar","car"])); -console.log(longestCommonPrefix(["cir","car"])); \ No newline at end of file diff --git a/Easy/palindrome_number.js b/Easy/palindrome_number.js deleted file mode 100644 index 1dcee5c..0000000 --- a/Easy/palindrome_number.js +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Leetcode 9 - * Given an integer x, return true if x is palindrome integer. - * - * An integer is a palindrome when it reads the same backward - * as forward. For example, 121 is palindrome while 123 is not. - * - * @param {number} x - * @return {boolean} - */ -var isPalindrome = function(x) { - let negative = x < 0; - if (negative) { return false; } // Ex: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome. - let palindrome = 0; - let tempX = x; - while(tempX > 0) { - let remainder = tempX % 10; // 123 % 10 = 3 - tempX = Math.floor(tempX / 10); // 123 / 10 = floor(12.3) = 12 - - palindrome = (palindrome * 10) + remainder; // (0 * 10) + 3 = 3 - } - return palindrome === x; -}; - -console.log(isPalindrome(121) ? "true" : "false"); -console.log(isPalindrome(10) ? "true" : "false"); // Reads 01 from right to left. Therefore it is not a palindrome. -console.log(isPalindrome(-101) ? "true" : "false"); // Reads -101 from left to right and 101- from right to left. Therefore it is not a palindrome. \ No newline at end of file diff --git a/Easy/reverse_num.js b/Easy/reverse_num.js deleted file mode 100644 index 1622467..0000000 --- a/Easy/reverse_num.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Leetcode 7 - * - * Given a signed 32-bit integer x, return x with its digits reversed. - * If reversing x causes the value to go outside the signed 32-bit - * integer range [-231, 231 - 1], then return 0. Assume the environment - * does not allow you to store 64-bit integers (signed or unsigned). - * - * Ex: - * Input: x = 123 - * Output: 321 - * - * Input: x = -123 - * Output: -321 - * - * Input: x = 120 - * Output: 21 - * - * @param {number} x - * @return {number} - */ -var reverse = function(x) { - - let reverse_num = 0; - // Check if number is negative - let negative = x < 0; - if(negative) - x = x * -1; - - while(x > 0) { - let remainder = x % 10; // 123 % 10 = 3 - x = Math.floor(x / 10); // 123 / 10 = floor(12.3) = 12 - - reverse_num = (reverse_num * 10) + remainder; // (0 * 10) + 3 = 3 - } - if(negative) - reverse_num *= -1; - - if(reverse_num > ((2 ** 31) - 1)|| reverse_num < (-1 * (2 ** 31))) - return 0; - - return reverse_num; -}; - -console.log(reverse(-120)) -console.log(reverse(20)) -console.log(reverse(5323043326)) -console.log(reverse(-2147483648)) \ No newline at end of file diff --git a/Easy/roman_to_integer.js b/Easy/roman_to_integer.js deleted file mode 100644 index a4c3379..0000000 --- a/Easy/roman_to_integer.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Leetcode 13 - * - * Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M - * - * Symbol Value - * I 1 - * V 5 - * X 10 - * L 50 - * C 100 - * D 500 - * M 1000 - * - * For example, 2 is written as II in Roman numeral, just two one's added together. - * 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, - * which is XX + V + II. - * - * Roman numerals are usually written largest to smallest from left to right. However, - * the numeral for four is not IIII. Instead, the number four is written as IV. Because - * the one is before the five we subtract it making four. The same principle applies to - * the number nine, which is written as IX. There are six instances where subtraction is used: - * - * I can be placed before V (5) and X (10) to make 4 and 9. - * X can be placed before L (50) and C (100) to make 40 and 90. - * C can be placed before D (500) and M (1000) to make 400 and 900. - * - * Given a roman numeral, convert it to an integer. - * - * @param {string} s - * @return {number} - */ -var romanToInt = function(s) { - let romanNumerals = { - I:1, - V:5, - X:10, - L:50, - C:100, - D:500, - M:1000 - } - let integer = 0; - for(var i = 0; i < s.length; i++) { - if(romanNumerals[s[i]] < romanNumerals[s[i+1]]){ - integer += (romanNumerals[s[i+1]] - romanNumerals[s[i]]); - i++; - } else { - integer += romanNumerals[s[i]]; - } - } - return integer; -}; - -console.log(romanToInt("III")); -console.log(romanToInt("IV")); -console.log(romanToInt("IX")); -console.log(romanToInt("LVIII")); -console.log(romanToInt("MCMXCIV")); \ No newline at end of file diff --git a/Easy/shift_2d_grid.js b/Easy/shift_2d_grid.js deleted file mode 100644 index c1586ce..0000000 --- a/Easy/shift_2d_grid.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. - * In one shift operation: - * Element at grid[i][j] moves to grid[i][j + 1]. - * Element at grid[i][n - 1] moves to grid[i + 1][0]. - * Element at grid[m - 1][n - 1] moves to grid[0][0]. - * Return the 2D grid after applying shift operation k times. - * - * - * - * - * - * - */ - - -/** - * @param {number[][]} grid - * @param {number} k - * @return {number[][]} - */ -var shiftGrid = function(grid, k) { - // Store all element into list - let list = []; - let newGrid = new Array(); - for(var row = 0; row < grid.length;row++) { - for(var col = 0; col < grid[row].length;col++) { - list.push(grid[row][col]); - } - } - // Append to front while popping off back - while(k > 0) { - list.unshift(list.pop()); - k--; - } - - for(var row = 0; row < grid.length;row++) { - let tempRow = new Array(); - for(var col = 0; col < grid[row].length;col++) { - tempRow.push(list.shift()) - } - newGrid.push(tempRow); - } - return newGrid; -}; - -console.log(shiftGrid([[1,2,3],[4,5,6],[7,8,9]],1)); -console.log(shiftGrid([[3,8,1,9],[19,7,2,5],[4,6,11,10],[12,0,21,13]],4)); \ No newline at end of file diff --git a/Easy/two_sum.js b/Easy/two_sum.js deleted file mode 100644 index e10df03..0000000 --- a/Easy/two_sum.js +++ /dev/null @@ -1,39 +0,0 @@ - -var twoSum = function(nums, target) { - let indexes = []; - for(let i = 0;i 0 && char === ')' && stack[stack.length-1] === '(') - stack.pop(); - else if (stack.length > 0 && char === ']' && stack[stack.length-1] === '[') - stack.pop(); - else if (stack.length > 0 && char === '}' && stack[stack.length-1] === '{') - stack.pop(); - else - return false; - } - return stack.length < 1; -}; - -console.log(isValid('([])[]')); -console.log(isValid('()[]{}')); -console.log(isValid('(')); \ No newline at end of file diff --git a/Medium/add_two_numbers.js b/Medium/add_two_numbers.js deleted file mode 100644 index 45a6196..0000000 --- a/Medium/add_two_numbers.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * You are given two non-empty linked lists representing two non-negative integers. - * The digits are stored in reverse order, and each of their nodes contains a single digit. - * Add the two numbers and return the sum as a linked list. - * You may assume the two numbers do not contain any leading zero, except the number 0 itself. - * - * Example: - * Input: l1 = [2,4,3], l2 = [5,6,4] - * Output: [7,0,8] - * Explanation: 342 + 465 = 807. - * - */ - - - /** - * Definition for singly-linked list. - * function ListNode(val, next) { - * this.val = (val===undefined ? 0 : val) - * this.next = (next===undefined ? null : next) - * } - */ - - function ListNode(val,next) { - this.val = (val===undefined ? 0 : val); - this.next = (next===undefined ? null : next); - } -/** - * @param {ListNode} l1 - * @param {ListNode} l2 - * @return {ListNode} - */ -var addTwoNumbers = function(l1, l2) { - - let p1 = l1, p2 = l2; - let result = new ListNode(); - let carry = 0; - let current = result; - while(p1 || p2) { - let x = p1 ? p1.val : 0; - let y = p2 ? p2.val : 0; - let sum = carry + x + y; - carry = Math.floor(sum/10); - - console.log(carry); - current.next = new ListNode(sum%10); - current = current.next; - - if(p1) - p1 = p1.next; - if(p2) - p2 = p2.next; - } - if (carry > 0) - current.next = new ListNode(carry); - return result.next; -}; - -let l1 = new ListNode(2,new ListNode(4,new ListNode(3))), l2 = new ListNode(5,new ListNode(6,new ListNode(4))); -let result = addTwoNumbers(l1,l2); - -console.log(result); \ No newline at end of file diff --git a/Medium/int_to_roman.js b/Medium/int_to_roman.js deleted file mode 100644 index 0fd40e1..0000000 --- a/Medium/int_to_roman.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @param {number} num - * @return {string} - */ -var intToRoman = function(num) { - if(num < 1 || num > 3999 ){ return ""; } - let result = ""; - let roman_num = { - M: 1000, CM: 900, - D: 500, CD: 400, - C: 100, XC: 90, - L: 50, XL: 40, - X:10, IX: 9, - V: 5, IV: 4, - I: 1, - } - let x = num; - let rom_num; - - while(x > 0) { - // Compare x to all values starting from the highest - for (const key in roman_num) { - if(x >= roman_num[key]) { - rom_num = key; - break; - } - } - // Find number of roman numerals needed - let temp = x / roman_num[rom_num]; - x = x % roman_num[rom_num]; - // Added roman numerals to the results string - for(var i = 0; i < Math.floor(temp);i++) { - result += rom_num; - } - } - return result; -}; - -console.log(intToRoman(1995)); -console.log(intToRoman(4)); -console.log(intToRoman(53)); -console.log(intToRoman(58)); -console.log(intToRoman(1994)); -console.log(intToRoman(9)); \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index dff0ffc..0000000 --- a/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# LeetCode Questions -Some Software Coding Challenges from LeetCode - - -| # | Difficulty | Title | Speed | Size | -| :------: | :--------: | :---: | :----: | :---: | -| [1]() | Easy | [Two Sum Solution](https://github.com/y0dev/code_challenges/blob/main/Easy/two_sum.js) | O(n^2) | O(n) -| [2]() | Medium | [Add Two Numbers](https://github.com/y0dev/code_challenges/blob/main/Medium/add_two_numbers.js) | O(n) | O(n) -| [7]() | Easy | [Reverse Integer](https://github.com/y0dev/code_challenges/blob/main/Easy/reverse_num.js) | O(n) | O(1) -| [12]() | Medium | [Integer to Roman](https://github.com/y0dev/code_challenges/blob/main/Medium/int_to_roman.js) | O(n^2) | O(1) -| [13]() | Easy | [Roman to Integer](https://github.com/y0dev/code_challenges/blob/main/Easy/roman_to_integer.js) | O(n) | O(1) -| [20]() | Easy | [Valid Parentheses](https://github.com/y0dev/code_challenges/blob/main/Easy/valid_parentheses.js) | O(n) | O(1) -| [1260]() | Easy | [Shift 2D Grid](https://github.com/y0dev/code_challenges/blob/main/Easy/shift_2d_grid.js) | O(n^2) | O(n) \ No newline at end of file diff --git a/actions.js b/actions.js new file mode 100644 index 0000000..276fe42 --- /dev/null +++ b/actions.js @@ -0,0 +1,47 @@ +function scrollToBottom() { + console.log('Scroll'); + window.scrollTo(0,document.body.scrollHeight); +} + +function saveLinkToJSON() { + console.log('Save'); + var paragraphs = document.getElementsByTagName('p'); + let demo = document.getElementById('demo'); + demo.hidden = false; + demo.innerHTML = `${paragraphs.length}`; + // let paras = {}; + + // for (const key in paragraphs) { + // if (Object.hasOwnProperty.call(paragraphs, key)) { + // const element = paragraphs[key]; + // console.log(key); + // } + // } + // const fetch = require('node-fetch'); + + // const url = "https://www.something.com/.../image.jpg" + + // async function download() { + // const response = await fetch(url); + // const buffer = await response.buffer(); + // fs.writeFile(`./image.jpg`, buffer, () => + // console.log('finished downloading!')); + // } +} + +function downloadURL(url, name) { + var link = document.createElement("a"); + link.download = name; + link.href = url; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + delete link; + } + + function downloadFile() { + var data = "okay this is epic"; + var blob = new Blob([data], {type: 'text/txt'}); + var url = window.URL.createObjectURL(blob); + downloadURL(url, "test.txt"); + } \ No newline at end of file diff --git a/images/.DS_Store b/images/.DS_Store new file mode 100644 index 0000000..aea26c4 Binary files /dev/null and b/images/.DS_Store differ diff --git a/images/icon_128.png b/images/icon_128.png new file mode 100644 index 0000000..41ad7e1 Binary files /dev/null and b/images/icon_128.png differ diff --git a/images/icon_16.png b/images/icon_16.png new file mode 100644 index 0000000..8f8f5ad Binary files /dev/null and b/images/icon_16.png differ diff --git a/images/icon_32.png b/images/icon_32.png new file mode 100644 index 0000000..7ea5048 Binary files /dev/null and b/images/icon_32.png differ diff --git a/images/icon_48.png b/images/icon_48.png new file mode 100644 index 0000000..a5e71ff Binary files /dev/null and b/images/icon_48.png differ diff --git a/lib/BinarySearchTree.js b/lib/BinarySearchTree.js deleted file mode 100644 index 0d305bf..0000000 --- a/lib/BinarySearchTree.js +++ /dev/null @@ -1,71 +0,0 @@ -class TreeNode { - constructor(value,leftNode = null,rightNode = null) { - this.value = value; - this.leftNode = leftNode; - this.rightNode = rightNode; - } -} - -class BinarySearchTree { - constructor() { - this.root = null; - this.levels = 1; - this.nodes = 0; - } - - insert(value) { - if(this.root === null) - this.root = new TreeNode(value); - else { - let node = this.root; - let newNode = new TreeNode(value); - this.#searchTree(node,newNode); - } - } - - searchFor(value) { - if(this.root == null) - return; - else { - let node = this.root; - if(value < node.value) { - if(node.leftNode !== null) { - return this.searchFor(node.leftNode.value); - } - } else if(value > node.value) { - if(node.rightNode !== null) { - return this.searchFor(node.rightNode.value); - } - } else { - return node; - } - } - } - - #searchTree = function(node,newNode) { - console.log(`${node.value} : ${newNode.value}`); - // determine if node is for left node - if(node.value > newNode.value) { - console.log(`Left: ${newNode.value}`); - // Check if left leaf is null - if (node.leftNode === null) { - node.leftNode = newNode; - } else { - return this.#searchTree(node.leftNode,newNode); - } - } else { - console.log(`Right: ${newNode.value}`); - // Check if right leaf is null - if (node.rightNode === null) { - node.rightNode = newNode; - } else { - return this.#searchTree(node.rightNode,newNode); - } - } - }; -} - -module.exports = { - TreeNode, - BinarySearchTree -} \ No newline at end of file diff --git a/lib/LinkList.js b/lib/LinkList.js deleted file mode 100644 index 1747ac2..0000000 --- a/lib/LinkList.js +++ /dev/null @@ -1,213 +0,0 @@ -class LinkNode { - constructor(value,next = null) { - this.value = value; - this.next = next; - } -} - -function LinkedList() { - function ListNode(val,next) { - this.val = (val===undefined ? 0 : val); - this.next = (next===undefined ? null : next); - } - let length = 0; - let head = null; - this.append = function(value) { - if(head === null) - head = new ListNode(value); - else { - let current = head; - while(current.next) { - current = current.next; - } - current.next = new ListNode(value); - } - length++; - } - - this.insert = function(position,value) { - if(position > -1 && position < length) { - let index = 0; - let current = head; - let previous; - while(index++ < position) { - previous = current; - current = current.next; - } - previous.next = new ListNode(value,current); - length++; - } - } - - this.removeAt = function(position) { - if (position > 0 && position < length) { - let index = 0; - let current = head; - let previous; - while(index++ < position) { - previous = current; - current = current.next; - } - previous.next = current.next; - length--; - } - } - - this.remove = function(value) { - if(head === null) - return false; - else { - let current = head; - let previous = null; - while(current) { - if(current.val === value) { - if(previous === null) - head = current.next - else - previous.next = current.next; - length--; - return true; - } - previous = current; - current = current.next; - } - } - return false; - } - - this.indexOf = function(value) { - if(head === null) - return null; - else { - let index = 0; - let current = head; - while (current){ - if(current.val === value) { - return index; - } - current = current.next; - index++; - } - } - return null; - } - - this.isEmpty = function() { - return length < 1; - } - - this.size = function() { - return length; - } - - this.toString = function() { - let string = ''; - if(head === null) - return string; - else { - let current = head; - let index = 0; - while(current) { - string += `${index}: ${current.val}` + (current.next ? ', ' : ''); - current = current.next; - index++; - } - } - return string; - } - - this.print = function() { - console.log(this.toString()); - } -} - -class LinkList { - constructor() { - this.head = null; - this.size = 0; - } - - append = function(value) { - if(this.head === null) - this.head = new LinkNode(value,this.head); - else { - let current = this.head; - while(current.next !== null) { - current = current.next; - } - current.next = new LinkNode(value); - } - this.size++; - } - - addToFront = function(value) { - this.insertAt(0,value); - } - - insertAt = function(pos,value) { - // Bound checking - if(pos === 0) { - this.head = new LinkNode(value,this.head); - this.size++; - return; - } - - if(pos > 0 && pos < this.size) { - let previous; - let current = this.head; - let index = 0; - while(pos > index++) { - previous = current; - current = current.next; - } - previous.next = new LinkNode(value,current); - this.size++; - } - } - - removeEnd = function(){ - if(this.head === null) - return; - else { - let previous = null; - let current = this.head; - while(current.next !== null) { - previous = current; - current = current.next; - } - previous.next = current.next - } - this.size--; - } - - toString() { - if(this.head === null) - return; - else { - let current = this.head; - let string = '['; - while(current !== null){ - string += `${current.value}` + (current.next ? ', ':''); - current = current.next; - } - string += ']' - return string; - } - } - - isEmpty(){ - return this.size === 0; - } - - print = function() { - console.log(this.toString()); - } - - -} - -module.exports = { - LinkNode, - LinkList, - LinkedList -} diff --git a/main.css b/main.css new file mode 100644 index 0000000..b6703c0 --- /dev/null +++ b/main.css @@ -0,0 +1,5 @@ + +.controller_panel { + margin: 10px; + align-items: center; +} \ No newline at end of file diff --git a/main.html b/main.html new file mode 100644 index 0000000..6e7cfe0 --- /dev/null +++ b/main.html @@ -0,0 +1,146 @@ + + + + + + Facebook Image Scaper + + + + + + + + +
+

Christ Reference Scrapper

+
+ +
+ + + +
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris + nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit + esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, + sunt in culpa qui officia deserunt mollit anim id est laborum. +

+ + \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..e13ec64 --- /dev/null +++ b/manifest.json @@ -0,0 +1,17 @@ +{ + "manifest_version": 2, + "name": "Christian Reference Scraper", + "description": "Scrap articles and blog from reformed Christian websites", + "version":"1.0.0", + "icon": { + "16": "images/icon_16.png", + "32": "images/icon_32.png", + "48": "images/icon_48.png", + "128": "images/icon_128.png" + }, + "browser_action" : { + "default_icon": "icon_20.png", + "deafault_popup": "main.html" + }, + "permissions": ["activeTab"] +} \ No newline at end of file diff --git a/practice/BinarySearchTree_Test.js b/practice/BinarySearchTree_Test.js deleted file mode 100644 index c6b1e5a..0000000 --- a/practice/BinarySearchTree_Test.js +++ /dev/null @@ -1,14 +0,0 @@ -const { BinarySearchTree } = require('../lib/BinarySearchTree'); - -const bst = new BinarySearchTree(); -bst.insert(20); -bst.insert(24); -bst.insert(7); -bst.insert(15); -bst.insert(5); -bst.insert(3); -bst.insert(9); -bst.insert(8); -bst.insert(10); -bst.insert(13); -bst.insert(12); diff --git a/practice/LinkList_Test.js b/practice/LinkList_Test.js deleted file mode 100644 index 098153f..0000000 --- a/practice/LinkList_Test.js +++ /dev/null @@ -1,24 +0,0 @@ -const {LinkList, LinkedList} = require('../lib/LinkList'); - -const list = new LinkList(); -list.append(4); -list.append(1); -list.append(5); -list.addToFront(10); -list.print(); -list.removeEnd(); -list.print(); -list.insertAt(1,2); -list.insertAt(0,2); -list.print(); - -const list1 = new LinkedList(); -list1.append('spot'); -list1.append('dog'); -list1.append('car'); -list1.print(); -console.log(list1.isEmpty()); -console.log(list1.size()); -list1.remove('spot'); -console.log(list1.indexOf('car')); -list1.print(); \ No newline at end of file diff --git a/practice/mergesort.js b/practice/mergesort.js deleted file mode 100644 index 0faa657..0000000 --- a/practice/mergesort.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Merge Sort - * - * Time Complexity O(nlog(n)) Space Complexity O(n) - * - * - * - * @param {Array} array - * @return {Array} - */ - -function mergeSort(array) { - return mergeSortRecursion(array); -} - -function mergeSortRecursion(array) { - if (array.length === 1) - return array; - let leftArray = array.slice(0,Math.floor(array.length/2)); - let rightArray = array.slice(Math.floor(array.length/2)); - return merge(mergeSortRecursion(leftArray),mergeSortRecursion(rightArray)); -} - -function merge(leftArray,rightArray) { - let numLA = leftArray.length; - let numRA = rightArray.length; - let array = []; - - let i = 0, j = 0, k = 0; - while(i < numLA && j < numRA) { - if(leftArray[i] <= rightArray[j]) { - array[k] = leftArray[i]; - i++; - } else { - array[k] = rightArray[j]; - j++; - } - k++; - } - while(i < numLA) { - array[k] = leftArray[i]; - i++; k++; - } - while(j < numRA) { - array[k] = rightArray[j]; - j++; k++; - } - - // console.log(array); - return array; -} - - -let sampA = [9,3,5,2,1,0,4,7,5] -console.log(sampA); -console.log(mergeSort(sampA)); - -let sampB = [9,2,3,4,7,5,-4,6,1] -console.log(sampB); -console.log(mergeSort(sampB)); \ No newline at end of file diff --git a/practice/recursive.js b/practice/recursive.js deleted file mode 100644 index e644961..0000000 --- a/practice/recursive.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Solve a recursive problem - * 1) What's the simplest possible input? (Base Case) - * 2) Play around with examples and visualize - * 3) Relate hard cases to simpler cases - * 4) Generalize the pattern - * 5) Write code by combining recursive - * patterns with the bases case - */ - -/* - * Write a function that given an input n - * sums all nonnegative integers up to n - * - * Ex : (n = 4): 0 + 1 + 2 + 3 + 4 = 10 - * (n = 3): 0 + 1 + 2 + 3 = 6 - * (n = 2): 0 + 1 + 2 = 3 - * (n = 1): 0 + 1 = 1 - * (n = k): 0 + 1 + 2 + 3 + ... + k - * k + sum(k - 1) - */ - - var sum = (n) => { - // Base Case - if(n == 0) - return 0; - else - return n + sum(n - 1); - } - -console.log(sum(4)); -console.log(sum(5)); -console.log(sum(14)); - -/* - * Write a function that takes to inputs n and m - * and outputs the number of unique paths from - * top left corner to bottom right corner of a - * n x m grid. - * - * Constraints: You can only move down or - * right 1 unit at a time - * - * Ex : (n = 2, m = 4): grid_paths = 4 - * (n = 0, m = 0): grid_paths = 0 - * (n = 1, m = 0): grid_paths = 1 - * (n = 2, m = 0): grid_paths = 1 - * (n = 0, m = 1): grid_paths = 1 - * (n = 0, m = 2): grid_paths = 1 - * (n = 1, m = 1): grid_paths = 1 - * (n = 1, m = 2): grid_paths = 1 - * (n = 2, m = 2): grid_paths = 2 - * (n = 2, m = 3): grid_paths = 3 - * (n = 2, m = 4): grid_paths = 4 - * (n = 3, m = 2): grid_paths = 3 - * (n = 4, m = 2): grid_paths = 4 - * - */ - - var grid_paths = (n,m) => { - // Base Case - if( n == 1 || m == 1) - return 1; - else - return grid_paths(n - 1, m) + grid_paths(n, m - 1); - } - -console.log(grid_paths(2,4)); -console.log(grid_paths(1,5)); -console.log(grid_paths(3,3)); \ No newline at end of file