Skip to content

Instantly share code, notes, and snippets.

Avatar

Manish Tomar manishtomar

View GitHub Profile
View keybase.md

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 Aug 29, 2015
Python tricks learned
View tricks.md
  • 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 Aug 29, 2015
Combining predicates
View predicates.hs
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