Skip to content

Instantly share code, notes, and snippets.

View yannick's full-sized avatar
🏗️

Yannick Koechlin yannick

🏗️
View GitHub Profile
@rkh
rkh / Scala
Created April 2, 2010 19:08
examples for sinatra like frameworks
package com.thinkminimo.step
class StepExample extends Step {
get("/") { "Hello World!" }
}
# Used for IO objects that need to report the current offset at each operation that changes the said offset
# (useful for building progress bars that report on a file read operation)
class ProgressiveIO < DelegateClass(IO)
# Should contain a block that accepts the current offset in bytes and the total size
attr_accessor :progress_block
# Get or set the total size of the contained IO. If the passed IO is a File object
# the size will be preset automatically
attr_accessor :total_size