Skip to content

Instantly share code, notes, and snippets.

View runtimee's full-sized avatar

Time Flies, Run With It runtimee

View GitHub Profile
def binary_search_basic(arr, target):
low, high = 0, len(arr)
while low < high:
mid = (low+high) // 2 # low + (high-low)//2 if cares about overflow
if target < arr[mid]:
high = mid
elif target > arr[mid]:
low = mid + 1
else:
return mid
@runtimee
runtimee / Grails_Groovy_Versions.txt
Created May 10, 2016 00:50 — forked from ishults/Grails_Groovy_Versions.txt
List of Groovy version for Grails
// Compiled by Igor Shults
// Last Updated: Jan. 26th, 2016
GRAILS GROOVY SOURCE
3.1.2 2.4.6 https://github.com/grails/grails-core/blob/695a11caa4025e91bdbf5094c0b6324cf5b22075/build.gradle
3.1.1 2.4.5
3.1.0RC2 2.4.5
3.1.0RC1 2.4.5
3.1.0M3 2.4.5
3.1.0M2 2.4.5 https://github.com/grails/grails-core/blob/c309bfe2f4613942cccbd2428f35ca6f0d018419/build.gradle
@runtimee
runtimee / tmux-cheatsheet.markdown
Created January 27, 2016 01:04 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
object x {
// stream a sql query
def sql( str:String ):Stream[ResultSet] = withStatement { s =>
val rs = s executeQuery str
new Iterator[ResultSet] { def hasNext = rs.next ; def next = rs }.toStream
}
// loan a sql statement