Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Gontovnikas mgonto

View GitHub Profile
View keybase.md

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 1316 6AE9 2A45 7160 296C DC12 7620 77C0 02B8 68CF

To claim this, I am signing this object:

@mgonto
mgonto / .gitignore
Last active Nov 19, 2015
Minimal WebTask Runner
View .gitignore
node_modules/
@mgonto
mgonto / code.js
Created Apr 13, 2015
webtaskcode
View code.js
return function(cb) { cb(null, {name: "Hello my dear friend"}); }
View Calling API
var request = new Request();
request.url = bla;
// Header sent automatically
request.make();
View CallingAPI
var request = new Request();
request.url = bla
request.header = {
// If he used session
Authorization: 'Bearer ' + A0Session.store.idToken
}
request.make();
@mgonto
mgonto / reactive.html
Created May 23, 2014
Reactive Example
View reactive.html
<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>
View keybase.md

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:

View matrixMax.rb
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
@mgonto
mgonto / one.scala
Created Nov 12, 2013
Scala Reactive
View one.scala
def heapList(heap: H): List[A] = {
if (isEmpty(heap)) {
Nil
} else {
findMin(heap) :: heapList(deleteMin(heap))
}
}
property("Added and removed elements") = forAll { (h: H, values: List[A]) =>
val listOfElemsBefore = heapList(h)
@mgonto
mgonto / event.js
Created Jun 4, 2013
Angularytics Track event with service
View event.js
angular.controller('MainCtrl', function(Angularytics, $scope) {
$scope.click = function() {
Angularytics.trackEvent("Home Category", "Button clicked");
}
});