Creating building docker image. Create Dockerfile with below content. Run docker build -t <image-name> .
FROM steveny/predictionio
CMD ["python", "app.py"]
EXPOSE 8000
Running a docker with image. -i opens interactive shell.
class Handler(tornado.web.RequestHandler): | |
def args_to_dict(self): | |
""" This method converts request arguments to | |
usable dict | |
""" | |
params = self.request.arguments | |
for k,v in params.items(): | |
params[k] = v[0].decode("utf-8") | |
return params |
var AppStorage = function(select){ | |
var self = this; | |
self.storageObject = chrome.storage.local; | |
if(select && select.settings && chrome.storage && chrome.storage.sync){ | |
self.storageObject = chrome.storage.sync; | |
} | |
self.get = function(key){ | |
return new Promise(function(resolve, reject){ |
from concurrent import futures | |
import requests | |
def get_data(url): | |
if url == 0: | |
return "working" | |
return requests.get(url).text | |
# Running a blocking task on executor. | |
# Increasing ThreadPool size or setting it to None, |
Creates a local chef cookbook on the current dir. | |
chef generate cookbook nodejs-install . | |
Running a chef script local | |
chef-client --local-mode <receipe-name>.rb |