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
| require 'net/http' | |
| require 'json' | |
| require 'uri' | |
| @token = '' | |
| def list_files | |
| ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago | |
| params = { | |
| token: @token, |
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
| // assignment: | |
| // Return all prime numbers between $nMin and $nMax (where $nMin and $nMax are arguments | |
| // supplied to your function)*Bonus points for clarity, coding standards and quality of comments. | |
| // Bonus points for efficiency of the algorithm. | |
| function isPrime(number) { | |
| if (number < 2) { | |
| return false; // number 1 or lower cannot be a prime number | |
| } else { | |
| for (var i = 2; i < number; i++) { // loop through numbers from 2 to number and check the modulo |