Skip to content

Instantly share code, notes, and snippets.

View gregorleban's full-sized avatar

Gregor Leban gregorleban

View GitHub Profile
@gregorleban
gregorleban / iterator
Created November 20, 2020 08:57
c++ glib iterator
TStrV AllSourceLocationUriV;
for (const TStr& LocUri : SourceLocationUriV) {
}
@gregorleban
gregorleban / mongoDB
Created June 19, 2019 20:14
[mongo db and collection] load the mongo client and a particular mongo db
from eventregistryadmin.MongoER import MongoER
self._mongoClient, erDataDb = MongoER.getERDatabase(MongoER.getMongoSettings("mongoSettings-er.json"))
sett = MongoER.getMongoSettings("mongoSettings-babaji-er-data.json")
self._mongoClient, ERdb = MongoER.getERDatabase(sett)
@gregorleban
gregorleban / currentPath.py
Created February 18, 2019 07:47
get path of the current file
currPath = os.path.split(__file__)[0]
@gregorleban
gregorleban / Event Registry hosts.py
Last active February 3, 2019 21:32
[Event Registry hosts] #python
# er = EventRegistry(host="http://beta.eventregistry.org", logging = False)
# er = EventRegistry(host="http://eventregistry.org", logging = False)
# er = EventRegistry(host="http://research.eventregistry.org", logging = False)
# er = EventRegistry(host="http://localhost:8090", logging = False)
@gregorleban
gregorleban / options parser.py
Last active February 3, 2019 21:32
[Using OptionParser] #python
```
# specify cmd-line args
from optparse import OptionParser
parser = OptionParser(usage="Usage: %prog mode [options]")
# params for downlading links
parser.add_option("-f", "--source-file", dest="sourceFile", action="store", type="string", default = None, help = "file with list of sources to analyze")
parser.add_option("-t", "--threads", dest="threads", action="store", type="int", default=30, help="number of threads used to process queue")
parser.add_option("-d", action="store_true", dest="download", help = "Download concept stats")