This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Foo | |
| def self.with_enthusiasm | |
| boring_old_methods = instance_methods(false) | |
| yield | |
| snazzy_new_methods = instance_methods(false) - boring_old_methods | |
| snazzy_new_methods.each do |method| | |
| method_without_chains = "#{method.to_s}_with_reset".to_sym | |
| alias_method method_without_chains, method | |
| define_method method do |*args| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this tests a critical regex used in the 'Whitelist Query Params' config in | |
| # Fastly, to transform request URLs into a normalized version that strips | |
| # 'traffic partner' tracking params and other noise, but leaves any valid keys | |
| # that match the params we actually use. A lot hinges on the proper operation | |
| # of this regex to keep hit ratio high but leave needed params intact. | |
| # | |
| # This version leaves trailing ? and &, which is unavoidable now but are pulled | |
| # out by a simple second sweep. | |
| # | |
| # http://regex101.com/r/oJ2gI6/10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- 123d2pKhY1JNsNsc0bzw4L_37.vcl 2014-10-03 08:22:28.000000000 -0400 | |
| +++ 123d2pKhY1JNsNsc0bzw4L_38.vcl 2014-10-03 08:22:03.000000000 -0400 | |
| @@ -421,14 +421,21 @@ | |
| # Header rewrite Whitelist Querystring : 10 | |
| - set req.url = regsuball(req.url, "(?:(?<=[?&])(?!_escaped_fragment_|brand|branch|type|min_msrp|max_msrp|_type|keywords|page|per_page|tags|name|order_by|adid|return_url|event|classifications|zip|website_ids)[^&]+?)(?:&|$)", ""); | |
| + set req.url = regsuball(req.url, "(^|[\\?&]+)([^&\\/=]+(?:(&|$))|(?!_escaped_fragment_|brand|branch|type|min_msrp|max_msrp|_type|keywords|page|per_page|tags|name|order_by|adid|return_url|event|classifications|zip|website_ids\\b)[^&\\/=]+=[^&]+)", "&"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- /Users/samoeba/Downloads/123d2pKhY1JNsNsc0bzw4L_38.vcl 2014-10-03 08:22:03.000000000 -0400 | |
| +++ /Users/samoeba/Downloads/123d2pKhY1JNsNsc0bzw4L_39.vcl 2014-10-03 13:49:59.000000000 -0400 | |
| @@ -421,7 +421,7 @@ | |
| # Header rewrite Whitelist Querystring : 10 | |
| - set req.url = regsuball(req.url, "(^|[\\?&]+)([^&\\/=]+(?:(&|$))|(?!_escaped_fragment_|brand|branch|type|min_msrp|max_msrp|_type|keywords|page|per_page|tags|name|order_by|adid|return_url|event|classifications|zip|website_ids\\b)[^&\\/=]+=[^&]+)", "&"); | |
| + set req.url = regsuball(req.url, "(^|[?&]+)([^&/=]+(?:(&|$))|(?!_escaped_fragment_|brand|branch|type|min_msrp|max_msrp|_type|keywords|page|per_page|tags|name|order_by|adid|return_url|event|classifications|zip|website_ids)[^&/=]+=[^&]+)", "&"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| varnishtest "#1030" | |
| server s1 { | |
| rxreq | |
| expect req.url == "/test" | |
| txresp | |
| rxreq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 14:45:40 - ERROR - Cannot decode JSON from PhantomJS runner: 795: unexpected token at 'Unsafe JavaScript attempt to access frame with URL about:blank from fra | |
| me with URL file:///Users/samoeba/.gem/ruby/2.0.0/gems/guard-jasmine-1.19.0/lib/guard/jasmine/phantomjs/guard-jasmine.js. Domains, protocols and ports must ma | |
| tch. | |
| > [#50A8AF5DD37C] | |
| > [#50A8AF5DD37C] Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///Users/samoeba/.gem/ruby/2.0.0/gems/guard-jasmine- | |
| 1.19.0/lib/guard/jasmine/phantomjs/guard-jasmine.js. Domains, protocols and ports must match. | |
| > [#50A8AF5DD37C] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| request = require 'request' | |
| logger = require('winston') | |
| lineReader = require('line-reader') | |
| q = require 'q' | |
| now = new Date | |
| first_time = null | |
| host = 'hydra-staging.herokuapp.com' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl -w | |
| my $dict = "/usr/share/dict/words"; | |
| my $maxlen = shift @ARGV; | |
| my $wordmin = 3; | |
| my $wordmax = 12; | |
| my $num_words = 4; | |
| my $skip_possessives = 1; # db contains 's forms for every noun |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Spree::DropdownVariantsByOption::OrdersController | |
| JS_ESCAPE_MAP = { '\\' => '\\\\', '</' => '<\/', "\r\n" => '\n', "\n" => '\n', "\r" => '\n', '"' => '\\"', "'" => "\\'" } | |
| def self.included(target) | |
| target.class_eval do | |
| create.before << :add_variants_from_option_values | |
| create.rescues ActiveRecord::RecordNotFound | |
| create.wants.js | |
| create.failure.wants.js { render :js => "alert('#{format_js_error}')" } |
OlderNewer