Skip to content

Instantly share code, notes, and snippets.

View sarveshseri's full-sized avatar

Sarvesh Kumar Singh sarveshseri

View GitHub Profile
Jan 1st, 2021 00:00:00 in India's Timezone
Jan 1st, 2021 00:00:00 in IST
Jan 1st, 2021 00:00:00 with UTC offset +05:30
Dec 31st, 2020 00:18:30 in UTC
Dec 31st, 2020 00:18:30 with UTC offset +00:00
Jan 1st, 2021 02:00:00 with UTC offset +07:30
// using ISO8601 representation,
@sarveshseri
sarveshseri / 1_python_related.md
Last active December 20, 2020 22:19
Python Related
@sarveshseri
sarveshseri / AutoTupling.scala
Last active September 20, 2019 17:55
Mysteries of Scala
def iWantATuple(tuple: (String, String)): println(tuple)
// what auto tupling does ?
// it tries to fit the aruments as tuples if possible
// the following will work even when its not a tuple
iWantATuple("a", "b")
// this is infamous for absurd compiler messages whenever a Java method is invloved and you pass wrong
@sarveshseri
sarveshseri / neptune-remote.yml
Last active September 19, 2019 22:36
neptune things
hosts: [your-neptune-endpoint]
port: 8182
connectionPool: { enableSsl: true, trustCertChainFile: "SFSRootCAG2.pem"}
serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
@sarveshseri
sarveshseri / mongo_dump_restore.md
Last active September 8, 2019 23:31
Mongo Related Things
mongodump \ 
--host mongo_host \
--username username \
--password password\
--authenticationDatabase auth_db_name \
--db db_name \
--out dump_path
@sarveshseri
sarveshseri / credentials
Last active September 7, 2019 20:38
how to use sbt with custom repositories
realm=my maven repo
host=my-maven-repo-host.com
user=xxxx
password=yyyy

First of all, lets understand few date-time standard definitions.

ISO Time String

The standard that we are talking about is formally named ISO 8601:1988 but is popularly also called ISO 8601

ISO 8601 also has support for

  • years before 0 AD or after 9999
  • Week based dates
  • Ordinal dates
@sarveshseri
sarveshseri / Main.scala
Created September 2, 2016 14:48
Medium :: Sbt :: The Simple Build Tool
object Main {
def main(args: Array[String]): Unit = {
println("---------")
println("Hi,")
println("I am Sbt and I am simple. :D")
println("---------")
}
}
@sarveshseri
sarveshseri / sbt_help.md
Last active August 26, 2016 13:19
Hey sbt! Who are you?

Our new project

lets say we want to start a new scala project.

cd ~/Works
mkdir ScalaProject

So... the base directory for our project is ~/Work/ScalaProject.

The sbt convention for sources

Now, sbt will follow convention to try to find the following automatically,

Install Oracle Java 8

Ubuntu
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
OSX