Skip to content

Instantly share code, notes, and snippets.

View manishtomar's full-sized avatar

Manish Tomar manishtomar

View GitHub Profile

Keybase proof

I hereby claim:

  • I am manishtomar on github.
  • I am manishtomar (https://keybase.io/manishtomar) on keybase.
  • I have a public key ASCpQHS__GMYEg-lDWrAH2vp9wgIpFkBmetHhip4NcGJeAo

To claim this, I am signing this object:

@manishtomar
manishtomar / tricks.md
Last active August 29, 2015 14:12
Python tricks learned
  • Passing default arg in next(). This is useful when you've to choose a value based on a condition. An example
@manishtomar
manishtomar / predicates.hs
Last active August 29, 2015 14:11
Combining predicates
all_preds :: [a -> Bool] -> a -> Bool
all_preds ps = \x -> and $ map (\p -> p x) ps
any_preds :: [a -> Bool] -> a -> Bool
any_preds ps = \x -> or $ map (\p -> p x) ps