- Browser
- Proxy
- Gateway
TODO Difference between proxy and gateway caches.
| #!/usr/bin/env ruby | |
| require(Dir.pwd + "/config/environment") | |
| ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env).each do |db_config| | |
| ActiveRecord::Base.establish_connection(db_config.config) | |
| context = ActiveRecord::Base.connection.migration_context | |
| missing_migrations = [] |
| from selenium import webdriver | |
| from selenium.webdriver.support import ui | |
| from selenium.webdriver.common.keys import Keys | |
| import time | |
| cargas = ['500', '300', '200', '150', '100', '50', '30', '20'] | |
| dict_cargas = {} | |
| i = 0 | |
| for c in cargas: |
| require 'barby' | |
| require 'barby/barcode/code_128' | |
| require 'barby/outputter/png_outputter' | |
| require 'mini_magick' | |
| require 'benchmark' | |
| # Build a sample barcode | |
| def build_barcode(prod, supplier_code, batch_no) | |
| bar_code = prod + "-" + supplier_code + "-"+ batch_no | |
| bar_code_image = bar_code.delete("/") # Clear all /'s in the code if any .. |
| class ActiveRecord::Base | |
| mattr_accessor :shared_connection | |
| @@shared_connection = nil | |
| def self.connection | |
| @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
| end | |
| end | |
| ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
| # Usage: | |
| # source iterm2.zsh | |
| # iTerm2 tab color commands | |
| # https://iterm2.com/documentation-escape-codes.html | |
| if [[ -n "$ITERM_SESSION_ID" ]]; then | |
| tab-color() { | |
| echo -ne "\033]6;1;bg;red;brightness;$1\a" | |
| echo -ne "\033]6;1;bg;green;brightness;$2\a" |
| =Navigating= | |
| visit('/projects') | |
| visit(post_comments_path(post)) | |
| =Clicking links and buttons= | |
| click_link('id-of-link') | |
| click_link('Link Text') | |
| click_button('Save') | |
| click('Link Text') # Click either a link or a button | |
| click('Button Value') |