- устанавливаем locust.io (для него нужен python >=2.7):
python3 -m pip install locust
- запускаем командой
locust
def ancestors | |
# Please read descedants comments for the entire method | |
return Supplier.none unless persisted? | |
# The raw SQL query for getting ancestors could be like this. | |
# Please note the differences. | |
# sql = <<~SQL | |
# WITH recursive ancestors AS ( | |
# SELECT * FROM suppliers_parent_suppliers s |
class LogRequestAndResponse | |
def initialize(app); @app = app; end | |
def call(env) | |
req = Rack::Request.new(env) | |
headers = Hash[*env.select {|k,v| k.start_with? 'HTTP_'} | |
.collect {|k,v| [k.sub(/^HTTP_/, ''), v]} | |
.collect {|k,v| [k.split('_').collect(&:capitalize).join('-'), v]} | |
.sort | |
.flatten] |
python3 -m pip install locust
locust
module Restrict | |
def ololo | |
module Restrictions | |
def allow(method_name, *classes) | |
# puts self.instance_methods(false) | |
# puts Model.instance_methods(false) | |
# puts Model.singleton_class.instance_methods(false) | |
puts self |
This allows to restrict some method calls and allow to only specific classes.
# frozen_string_literal: true | |
Sequel.migration do | |
up do | |
run 'CREATE EXTENSION IF NOT EXISTS "cube";' | |
run 'CREATE EXTENSION IF NOT EXISTS "earthdistance";' | |
end | |
down do | |
run 'DROP EXTENSION IF EXISTS "earthdistance";' |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# All Vagrant configuration is done below. The "2" in Vagrant.configure | |
# configures the configuration version (we support older styles for | |
# backwards compatibility). Please don't change it unless you know what | |
# you're doing. | |
Vagrant.configure(2) do |config| | |
# The most common configuration options are documented and commented below. | |
# For a complete reference, please see the online documentation at |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
# This extension is useful for sharded environment. | |
# It logs server name, for which connection is picked from pool. | |
# Logging happens using Database::log_info method, so be sure to set logger to database. | |
# The extension simply overrides original pick_server method and logs server name argument. | |
module Sequel | |
module LogServerName | |
def self.extended(db) | |
pool = db.pool | |
# check if pool is sharded |
Новый баннер работает на html5, благодаря чему он работает в Chrome. Находится html5-версия внутри iframe, который теперь нужно вставлять на страницу вместо флешки. Адреса iframe для разных игр перечислены ниже.
Есть два баннера - верхний (тулбар) и нижний (ротатор). Они находятся на разных html-страницах. Сами iframe отличаются высотой.