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
def iterative_binary_search(array, value) | |
start = 0 | |
top = array.size - 1 | |
while top >= start | |
middle = (start + top) / 2 | |
if array[middle] == value | |
return middle | |
elsif array[middle] > value | |
top = middle - 1 |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
'use strict' | |
do -> | |
BM = window.BM | |
storage = chrome.storage.local | |
authBaseUrl = BM.serverURL + '/oauth/authorize' | |
onTokenSet = (token) -> | |
console.debug 'token set to', token | |
return |