Skip to content

Instantly share code, notes, and snippets.

@gitjul
gitjul / field_with_error.rb
Created September 20, 2017 14:40
Add an error class to invalid fields and labels, overriding the standard Rails behaviour of wrapping them in div.field_with_errors
# /config/initializers/field_with_error.rb
# Based on https://gist.github.com/niklas/772018
ActionView::Base.field_error_proc = proc do |html_tag, _instance|
if html_tag.match? %r{<(input|label|textarea|select)}
error_class = "has-error"
doc = Nokogiri::XML(html_tag)
doc.children.each do |field|
next if field["type"] == "hidden"
2013-09-19 16:15:46,916 INFO myhost-0 thread-0: finished 1 run
2013-09-19 16:15:46,917 INFO myhost-0 : elapsed time is 12223 ms
2013-09-19 16:15:46,917 INFO myhost-0 : Final statistics for this process:
2013-09-19 16:15:46,938 INFO myhost-0 :
Tests Errors Mean Test Test Time TPS Mean Response Response Mean time to Mean time to Mean time to
Time (ms) Standard response bytes per errors resolve host establish first byte
Deviation length second connection
(ms)
(Test 100 1 0 1255,00 0,00 0,08 0,00 0,00 0 0,00 0,00 0,00) "Page 1"
grinder.script = grinder_test.py # path to test script
grinder.processes = 1 # number of worker processes each agent starts, default 1
grinder.threads = 3 # threads for each process, default 1
grinder.runs = 5 # number of iterations, default 1, when 0 if console started, then run until the console sends a stop or reset signal
# grinder.consoleHost = consolehost
# grinder.consolePort # default 6372
grinder.logDirectory = log/grinder # default agent's working dir
grinder.numberOfOldLogs = 3 # default 1
#!/bin/bash
GRINDERPATH=/path/to/grinder/dir
CLASSPATH=$GRINDERPATH/lib/grinder.jar:$CLASSPATH
GRINDERPROPERTIES=/path/to/grinder/properties/file
export CLASSPATH GRINDERPROPERTIES
# add java to PATH if needed
# The Grinder 3.10
# HTTP script recorded by TCPProxy at 2013-08-22 15:23:15
from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
from HTTPClient import NVPair
connectionDefaults = HTTPPluginControl.getConnectionDefaults()
httpUtilities = HTTPPluginControl.getHTTPUtilities()
# The Grinder 3.10
# HTTP script recorded by TCPProxy at 2013-08-22 15:23:15
from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
from HTTPClient import NVPair
connectionDefaults = HTTPPluginControl.getConnectionDefaults()
httpUtilities = HTTPPluginControl.getHTTPUtilities()
@@ -8,7 +8,7 @@
.country-select .country-select__link:before,.country-select--compact .country-select__link:before,.country-select--above .country-select__link:before{position:absolute;content:"";height:.61538em;width:.61538em;width:.46154em;background-image:url("/us/static/images/ui_sprite.png");background-position:-58px -41px;background-repeat:no-repeat;right:-1.15385em;top:50%;margin-top:-5px;width:8px}
.country-select .country-select__link:hover,.country-select--compact .country-select__link:hover,.country-select--above .country-select__link:hover{text-decoration:none}.country-select .country-select__link img,.country-select--compact .country-select__link img,.country-select--above .country-select__link img{height:22px;margin-right:.38462em;margin-top:-0.38462em;vertical-align:middle}
.country-select .country-select__content,.country-select--compact .country-select__content,.country-select--above .country-select__content{border:0;z-index:100;padding-left:0;min-width:10.76923em;top:100%;list-style:none;
<!DOCTYPE html>
<html>
<head>
<title>Meetup</title>
<link href="/assets/twitter/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bootstrap-glyphicons.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.core.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.theme.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.datepicker.css?body=1" media="all" rel="stylesheet" type="text/css" />
<!DOCTYPE html>
<html>
<head>
<title>Meetup</title>
<link href="/assets/twitter/bootstrap.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/bootstrap-glyphicons.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.core.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.theme.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.datepicker.css?body=1" media="all" rel="stylesheet" type="text/css" />
<link href="/assets/jquery.ui.menu.css?body=1" media="all" rel="stylesheet" type="text/css" />