Joined September 2011
·
000f45b685d4d6ff1a171676512c382e

Pavel

Ruby developer at Veritrans
Ruby developer
Veritrans
·
Jakarta, Indonesia
·
·

To have less env variables can pass it in URL format:

if ENV["SMTP_URL"]
  smtp_url = URI.parse(ENV["SMTP_URL"])
  self.smtp_settings = {
    address:   smtp_url.host,
    port:      smtp_url.port,
    user_name: smtp_url.user ? URI.decode_www_form_component(smtp_url.user) : nil,
    password:  smtp_url.password,
    enable_starttls_auto: Rack::Utils.parse_nested_query(smtp_url.query)['tls'].in?(['true', '1', 1, true, 'True', 'TRUE'])
  }
end
Posted to Postgres common commands over 1 year ago

\? - to see help

There is a difference between for and forEach. for will local reassign variable for every run, while forEach will create new variable. Example:

var links = document.getElementsByTagName('a');
for(var i = 0; i < links.length; i++) {
  var element = links[i];
  element.addEventListener('click', function () {
    alert(element.innerText); // you think it will be element you clicked on? It will be last element in array
  });
}

I find this useful for me:

ObjectKit.forEach = function Object_forEach (object, callback) {
  for (var key in object) {
    if (object.hasOwnProperty(key)) callback(key, object[key]);
  }
};
Posted to Continuous testing for D over 1 year ago
Posted to iTunes 12 blue icon over 1 year ago

Thank you for link. It's almost same with manual I mentioned, paste image in "get info" window. For me it worked only if I open icon in preview.app and copy image (not a file)

Achievements
191 Karma
18,694 Total ProTip Views