This file contains hidden or 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
| /** | |
| * Write a function to find the longest common prefix string in an array of strings. | |
| * -------------------------------- | |
| * Function to find matching characters and stop at the | |
| * point at which they are different or if the string ends | |
| * | |
| * Worked with https://twitter.com/Spraggsz_ to solve! | |
| * @return {string} | |
| */ |
This file contains hidden or 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 generateAnagram (string, prefix = '', combinations = []) { | |
| for (let i = 0; i < string.length; i++) { | |
| const current = string[i] | |
| let otherChars = '' | |
| for (let j = 0; j < string.length; j++) { | |
| if (j !== i) { | |
| otherChars += string[j] | |
| } | |
| } | |
| if (current.length + otherChars.length === 2) { |
This file contains hidden or 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
| # If you have all your repos on the same folder | |
| # Run the following script to get a total of all your | |
| # commits in all your repos. | |
| rm -f total.txt | |
| for directory in */ | |
| do | |
| cd $directory | |
| if [ -d .git ]; then | |
| # Your name goes here, mine would be Daniel Prada | |
| git shortlog -s -n --all --no-merges | grep "Daniel Prada" >> ../total.txt |
This file contains hidden or 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 Queue { | |
| constructor (size) { | |
| this.slots = [] | |
| this.front = 0 | |
| this.back = 0 | |
| for (let i = 0; i < size; i++) { | |
| this.slots.push(undefined) | |
| } | |
| } |
This file contains hidden or 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
| <html> | |
| <head> | |
| <link rel="stylesheet" href="bootstrap.css"> | |
| <script src="vue.js"></script> | |
| <style> | |
| .total { | |
| font-size: 3em; | |
| font-weight: 200; | |
| display: block; | |
| } |
This file contains hidden or 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 columns = ['a','b','c','d','e', 'f', 'g', 'h']; | |
| function compareColumns (array, sizeOfGroup) { | |
| var arrayCutoff = sizeOfGroup - 2; | |
| for (var i = 0; i < array.length - 1; i++) { | |
| var currentLetter = array[i]; | |
| var currentLetterIndex = i; |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <div> | |
| <img src="http://placehold.it/400x300&text=1" id="1" style="display:none" | |
| /> | |
| <img src="http://placehold.it/400x300&text=2" id="2" style="display:none" |
This file contains hidden or 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
| //These are a mix of one's Ive found in CSS tricks, CodeSchool as well as some I've found useful for cross-browser css. | |
| //I've alphabetized and stretched the mixins horizontally to allow users to be able to quickly see all the mixin titles. | |
| // ============================== // | |
| // Alphabetized Mixins // | |
| // ============================== // | |
| @mixin border-radius ($rad) {-moz-border-radius: ($rad);-webkit-border-radius: ($rad); border-radius: ($rad);-khtml-border-radius:($rad);} |