Skip to content

Instantly share code, notes, and snippets.

Avatar

Hamid hamidr

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am hamidr on github.
  • I am 1hamidr (https://keybase.io/1hamidr) on keybase.
  • I have a public key ASDxHGQzij7bT0_0PyICcSxSPRwU3UkAEpavutBHv_V1tAo

To claim this, I am signing this object:

View mygist.scala
object MyTest {
def main(args: Array[String]): Unit = {
println(sequence1(Seq(Some(1), None, Some(2), None)))
println(sequence2(Seq(Some(1), Some(3), Some(2), Some(5))))
}
def sequence1[T](items: Seq[Option[T]]): Option[Seq[T]] = {
items.foldLeft(Option(Seq[T]())) { (res, e) =>
e match {
View gist:591c8737e419969d1567d899be1e245e
✗ make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hamid/adro/async-redis/build
Scanning dependencies of target parser
[ 4%] Building CXX object CMakeFiles/parser.dir/src/parser/base_resp_parser.cpp.o
[ 8%] Building CXX object CMakeFiles/parser.dir/src/parser/array_parser.cpp.o
[ 13%] Building CXX object CMakeFiles/parser.dir/src/parser/bulk_string_parser.cpp.o
[ 17%] Building CXX object CMakeFiles/parser.dir/src/parser/error_parser.cpp.o
[ 21%] Building CXX object CMakeFiles/parser.dir/src/parser/number_parser.cpp.o
View gist:7f829088a40cace4b183
### Keybase proof
I hereby claim:
* I am hamidr on github.
* I am hamidr (https://keybase.io/hamidr) on keybase.
* I have a public key whose fingerprint is BBF0 99B2 6EE7 9A27 1D32 9226 ADF6 4645 AA37 EFEB
To claim this, I am signing this object:
You can’t perform that action at this time.