I hereby claim:
- I am nod on github.
- I am nod (https://keybase.io/nod) on keybase.
- I have a public key whose fingerprint is 67FA B939 5A9C 1A30 5E3F DE2B 4FC8 016B 8E58 67CA
To claim this, I am signing this object:
| >>> sample = {"a":2,"b":{"c":44}} | |
| >>> sample.get("b",{}).get("c") # is gross | |
| >>> | |
| >>> class nestdict(dict): | |
| ... def __floordiv__(self, k): | |
| ... v = self.get(k) | |
| ... if isinstance(v, dict): return nestdict(v) | |
| ... return v | |
| ... | |
| >>> z = nestdict(sample) |
| /* | |
| Prior to this, I would build up `cfgMap` from my command line options. | |
| If `'config` exists, that will load the run time config file and overlay it on top of the default config. | |
| */ | |
| // setup our default config | |
| lazy val defaultConfig = ConfigFactory.parseResources("default.conf") | |
| var conf = defaultConfig | |
| // do we have a runtime config file? | |
| val cfgFilePath = cfgMap.getOrElse('config, Nil) |
| Exception in thread "main" org.apache.spark.SparkException: Application application_1509398305238_0002 finished with failed status | |
| at org.apache.spark.deploy.yarn.Client.run(Client.scala:1104) | |
| at org.apache.spark.deploy.yarn.Client$.main(Client.scala:1150) | |
| at org.apache.spark.deploy.yarn.Client.main(Client.scala) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | |
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | |
| at java.lang.reflect.Method.invoke(Method.java:498) | |
| at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:755) | |
| at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180) |
| import random | |
| import time | |
| s = set() | |
| for x in xrange(1000): | |
| s.add(str(random.randint(1,1000000))) | |
| d = {x:1 for x in s} | |
| n = d.keys()[:400] | |
| n.extend([ str(random.randint(1,1000000)) for i in xrange(1000) ]) |
I hereby claim:
To claim this, I am signing this object:
Instead of installing bower, gulp, ionic, cordova globally - I prefer to put them in the directory with the project. This way projects can have their own versions as needed.
You'll create a file env.sh that lives at the root of your ionic project that
you'll source when you start working to ensure everything is setup properly.
| # For pymongo against mongodb 3.2... | |
| # Given a collection of documents like | |
| # {'textfield': 'cool stuff in a doc', 'other': 'fields...'} | |
| # | |
| # To perform the query, and get results sorted by the textual score: | |
| db.my_collection.create_index([('textfield','text')]) | |
| cursor = db.my_collection.find( | |
| {'textfield': 'some string query'}, |
| #!/bin/sh | |
| # usage: ios_icons some_file.png | |
| # output: creates images in needed sizes for iOS icon files | |
| # ex: some_file_SIZE.png | |
| inf=$1 | |
| filename=$(basename "$inf") | |
| ext="${filename##*.}" |
| location /syncgw { | |
| proxy_pass http://127.0.0.1:4984/syncgw; | |
| proxy_redirect off; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_pass_header Server; | |
| proxy_http_version 1.1; | |
| proxy_set_header Upgrade $http_upgrade; | |
| proxy_set_header Connection "upgrade"; | |
| proxy_pass_header Accept; |
| from ansible import playbook, callbacks | |
| # uncomment the following to enable silent running on the playbook call | |
| # this monkey-patches the display method on the callbacks module | |
| # callbacks.display = lambda *a,**ka: None | |
| # the meat of the meal. run a playbook on a path with a hosts file and ssh key | |
| def run_playbook(playbook_path, hosts_path, key_file): | |
| stats = callbacks.AggregateStats() | |
| playbook_cb = callbacks.PlaybookCallbacks(verbose=0) |