Skip to content

Instantly share code, notes, and snippets.

View mgonto's full-sized avatar

Martin Gontovnikas mgonto

View GitHub Profile
def max_contiguous_submatrix_n3(m)
rows = m.count
cols = rows ? m.first.count : 0
vps = Array.new(rows)
for i in 0..rows
vps[i] = Array.new(cols, 0)
end
for j in 0...cols

Keybase proof

I hereby claim:

  • I am mgonto on github.
  • I am mgonto (https://keybase.io/mgonto) on keybase.
  • I have a public key whose fingerprint is 7EB8 3BE2 F562 C3BF FCDF 6E21 3DC1 36F4 164A E6CC

To claim this, I am signing this object:

@mgonto
mgonto / reactive.html
Created May 23, 2014 22:04
Reactive Example
<div data-repat="app in AppTypes" data-class="app.name">
<div data-class="{selected: app.selected}"></div>
<a on-click="apptypeselect(app)">{{app.name}}</a>
</div>
var request = new Request();
request.url = bla
request.header = {
// If he used session
Authorization: 'Bearer ' + A0Session.store.idToken
}
request.make();
@mgonto
mgonto / Calling API
Created October 1, 2014 15:13
Angular
var request = new Request();
request.url = bla;
// Header sent automatically
request.make();
@mgonto
mgonto / code.js
Created April 13, 2015 19:38
webtaskcode
return function(cb) { cb(null, {name: "Hello my dear friend"}); }
@mgonto
mgonto / factorialtailrec.scala
Created September 26, 2012 04:13
Factorial Tail Rec
object factorial {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
def factorial(n : Int) : Int = {
if (n == 0) 1 else n * factorial(n-1)
} //> factorial: (n: Int)Int
def factorial2(n : Int) : Int = {
def innerFact(n : Int, count : Int, acum : Int) : Int = {
@mgonto
mgonto / .gitignore
Last active November 19, 2015 21:57
Minimal WebTask Runner
node_modules/
@mgonto
mgonto / Register.scala
Last active December 9, 2015 22:48
FactoryPal Register
FactoryPal.register[Person]() { person =>
person.name.mapsTo("gonto") and
person.age.isRandom
}
@mgonto
mgonto / Build.scala
Last active December 9, 2015 22:48
FactoryPal dependency
import sbt._
import sbt.Keys._
object ApplicationBuild extends Build {
lazy val root = Project(
id = "factory_pal_sample",
base = file("."),
settings = Project.defaultSettings ++ Seq(
name := "factory_pal_sample",