Skip to content

Instantly share code, notes, and snippets.

Avatar

citykid thulka

  • Vienna
View GitHub Profile
@thulka
thulka / puddles.py
Last active Dec 28, 2015
Michael Kozakov blogged about a twitter interview question
View puddles.py
# twitter interview question: http://qandwhat.apps.runkite.com/i-failed-a-twitter-interview/
#
# single pass
# recursive
#
# for debug and understanding, the function acc(umulate) returns the array of water levels in each bin.
def acc(land, i=0, leftmax=0):
leftmax = max(leftmax, land[i])
@thulka
thulka / jasmine.matcher.ts
Last active Jun 13, 2020
jasmine matcher in typescript - example. This one does the same as toEqual does on arrays.
View jasmine.matcher.ts
module jasmine {
interface Matchers {
toHaveSameSequence(expected: any[]): boolean;
}
}
beforeEach(function () {
this.addMatchers(
{
toHaveSameSequence: function(expected: any[]) {
You can’t perform that action at this time.