Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.
- ⌘ : Command key
- ⌃ : Control key
- ⌫ : Delete key
- ← : Left arrow key
- → : Right arrow key
- ↑ : Up arrow key
Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.
| /* | |
| Filter! | |
| Test 1 | |
| Name your function filterOutOdds | |
| Write a function that takes a list and filters out all the odd numbers | |
| Takes one parameter, a list of numbers | |
| Returns a list with only the even numbers remaining | |
| */ |
| /* | |
| ArrayList | |
| We are going to approximate an implementation of ArrayList. In JavaScript terms, that means we are | |
| going to implement an array using objects. You should not use arrays at all in this exercise, just | |
| objects. Make a class (or constructor function; something you can call new on) called ArrayList. | |
| ArrayList should have the following properties (in addition to whatever properties you create): | |
| length - integer - How many elements in the array | |
| push - function - accepts a value and adds to the end of the list |
| function bubbleSort(nums){ | |
| var swapped = false; | |
| do { | |
| swapped = false; | |
| for(var i = 0; i < nums.length; i++) { | |
| if(nums[i] > nums[i+1]) { | |
| var temp = nums[i]; | |
| nums[i] = nums[i+1]; | |
| nums[i+1] = temp; | |
| swapped = true; |
| function factorial(n) { | |
| var f = 1; | |
| if (n < 0) { | |
| throw "integer must be non-negative"; | |
| } else if (n === 0) { | |
| return 1; | |
| } for(var i=1; i<=n; i++) { | |
| f *= n; | |
| } | |
| return f; |
| function power(n, e) { | |
| var f = 1; | |
| for (var i=1; i <= Math.abs(e); i++) { | |
| f *= n | |
| } | |
| return f === (e < 0) ? 1/f : f | |
| } |
| function fib(n) { | |
| var a = 0, b = 1, f = 1; | |
| for (var i = 2; i <= n; i++) { | |
| f = a + b; | |
| a = b; | |
| b = f; | |
| } | |
| return f; | |
| } |
| config = { _id: "m101", members:[ | |
| { _id : 0, host : "localhost:27017"}, | |
| { _id : 1, host : "localhost:27018"}, | |
| { _id : 2, host : "localhost:27019"} ] | |
| }; | |
| rs.initiate(config); | |
| rs.status(); |
| git rm -r --cached some-directory | |
| git commit -m 'Remove the now ignored directory "some-directory"' | |
| git push origin master |
| function palindromeChk(str) { | |
| return str = str.split('').reverse().join(''); | |
| } | |
| // add following to remove any white spaces from phrases or sentences: | |
| // str = str.toLowerCase().replace(/\W/g, ''); | |