Skip to content

Instantly share code, notes, and snippets.

View ashlinchak's full-sized avatar

Oleksandr Shlinchak ashlinchak

  • Berlin, Germany
View GitHub Profile
@ashlinchak
ashlinchak / binary_search.rb
Last active July 7, 2017 17:41
Binary Search.
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
@ashlinchak
ashlinchak / 0_reuse_code.js
Created August 30, 2016 08:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ashlinchak
ashlinchak / background.coffee
Created August 10, 2016 19:50
Background page for authentication flow in the chrome extension
'use strict'
do ->
BM = window.BM
storage = chrome.storage.local
authBaseUrl = BM.serverURL + '/oauth/authorize'
onTokenSet = (token) ->
console.debug 'token set to', token
return