Posts

extjs - Change color of the field when condition is satisfied -

for example, have textfield input type 'email'. have set default color of field pink. if input in proper email format, want textfield's color changed white. how do that? the eg code: xtype: 'textfield', labelwidth : 250, fieldstyle: 'background-color : #f5a9a9', vtype : 'email', fieldlabel: 'email address' in case first need check weather input value email or not. using var fieldvalidation = ext.form.field.vtypes.email(val); if fieldvalidation true input value email. once verified input value change our background color. this.setfieldstyle("background-color : #ffffff") your code : { xtype: 'textfield', fieldstyle: 'background-color : #f5a9a9', vtype : 'email', fieldlabel: 'email address', validator : function(val){ var fieldvalidation = ext.form.field.vtypes.email(val); if(fieldvalidation == true){ ...

elasticsearch - Kibana 5.x - Sorting options (asc & desc) are not aviable -

after inserting data elasticsearch can't sort results in kibana discover view. test data inserted using curl and/or logstash. both variants did not lead success. i using current versions (5.2) of elk stack. the picture below shows result table without sorting options (desc or asc), instance, 'time' or 'message' field. result table without sorting option furthermore, can seen on left in picture inserted data have no indexed fields. why can't sort results? thanks help!

ruby on rails 4 - Broken FB-omniauth after bundle update, invalid credentials -

the oauth data doesn't go controller action. can't understand what's wrong. there 1 more auth provider in controller , works core absolutely same. devise 3.5.10 rails 4.2.4 devise.rb config.omniauth :facebook, figaro.env.fb_app_id, figaro.env.fb_app_secret, callback_url: 'https://chotam.ru/users/auth/facebook/callback', scope: 'email, publish_actions' class users::omniauthcallbackscontroller < devise::omniauthcallbackscontroller def facebook logger.error "fb here" # it's no output here on request!!! logger.error(request.env['omniauth.auth']) result = user.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) @user = result[:user] status = result[:status] if @user token = request.env["omniauth.auth"]["credentials"]["token"] @user.account.update_attribute(:fb_token, token) if status[:redirect] == 'added' ...

Select2 Tags with predefined (often used) -

i want use select2 multiple tags option fetch ajax. under select field want list used ones. on click should added select2. https://select2.github.io/examples.html#programmatic (set california , alabama) it's not working tags.

diskspace - Docker - free up space after removing all images & containers -

i have deleted images/containers ubuntu@ubuntu:/var/lib/docker$ docker images repository tag image id created size ubuntu@ubuntu:/var/lib/docker$ docker ps -a container id image command created status ports names but notice there still 15gb inside /var/lib/docker ubuntu@ubuntu:/var/lib/docker$ sudo du --max-depth=1 -h . 12g ./volumes 104k ./aufs 4,0k ./containers 1,3m ./image 4,0k ./trust 4,0k ./swarm 2,6g ./tmp 108k ./network 15g . questions: how can free space? is safe remove things inside /var/lib/docker ? try (from docker 1.13): docker system df it shows size of: images containers local volumes and remove local volumes using: docker volume prune for older dockers try: docker volume rm $(docker volume ls -q)

javascript - Make translation function not translate result again -

i have made simplified version of translation tool similar google translate. idea build simple tool minority language in sweden called "jamska". app built function takes string textarea id #svenska , replaces words in string using regexp. i've made array called arr that's used in loop of function dictionary. each array item looks this: var arr = [["eldröd", "eillrau"], ["oväder", "over"] ...] . first word in each array item in swedish, , second word in jamska. if regexp finds matching word in loop replaces word using code: function translate() { var str = $("#svenska").val(); var newstr = ""; (var = 0; < arr.length; i++) { var replace = arr[i][0]; var replacewith = arr[i][1]; var re = new regexp('(^|[^a-z0-9åäö])' + replace + '([^a-z0-9åäö]|$)', 'ig'); str = str.replace(re, "$1" + replacewith + '$2'); } $("#jamska").val(str); ...

python - Heroku flask app - Not able to scrape data -

i trying make 1 program can scrape site. achieve method implementing in heroku , flask. app.py from flask import flask import requests bs4 import beautifulsoup datetime import datetime app = flask(__name__) @app.route('/') def homepage(): r = requests.get('https://www.google.com') soup = beautifulsoup(r.content) l = soup.find_all('a') the_time = datetime.now().strftime("%a, %d %b %y %l:%m %p") return """ {time} \n\n\n {text} """.format(time=the_time,text = l) if __name__ == '__main__': app.run(debug=true, use_reloader=true) but after deploying , going site, giving error , in log find this: at=error code=h10 desc="app crashed" method=get path="/favicon.ico" host=young-chamber-36373.herokuapp.com request_id=68c83de9-1945-416c-8858-f9ff3d6ee496 fwd="171.77.135.239" dyno= connect= service= status=503 bytes= protocol=https so doing w...