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
| worker_pool 6 | |
| queue '*' | |
| before_fork do | |
| require File.expand_path('config/environment') | |
| Rails.application.eager_load! | |
| ActiveRecord::Base.connection.disconnect! | |
| end |
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
| # add this to app/controllers/application_controller.rb: | |
| def cache | |
| options = { | |
| 'no-store' => 'no-store', | |
| 'no-cache' => 'no-cache', | |
| 'zero-age' => 'max-age=0', | |
| } | |
| if cc = options[params[:id]] | |
| headers['Cache-Control'] = cc | |
| end |
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
| require 'multi_json' | |
| require 'stringio' | |
| require 'zlib' | |
| def gz(infile) | |
| outfile = infile + '.gz' | |
| File.open(outfile, 'w') do |f| | |
| f << `gzip -9 -c #{infile}` | |
| end | |
| outfile |
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
| 20:09:53 (0) [master] >>> cat | |
| ] | |
| == | |
| ]]]]] | |
| ^[[B\\\\=] | |
| \\\\=] | |
| '[ | |
| '\\'\\\\ | |
| '\\;'[-0kkkkkkkkkk[i-k-=k;/. \\m['''' |
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
| #!/bin/sh | |
| # Make sure sudoing works first, because tcpdump is going in the background | |
| sudo -p "Root privileges are required in order to run tcpdump. Password: " test | |
| pcap=$TMPDIR/nethog.$$.pcap | |
| # 10.0.1.1 is my LAN's AirPort Extreme, so it gets lots of backup traffic. | |
| sudo tcpdump -i en0 -w $pcap not host 10.0.1.1 >&/dev/null & | |
| tcpdump_pid=$! |
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
| def a | |
| [1,2,3].each do |x| | |
| return :a if x == 2 | |
| end | |
| :not_a | |
| end | |
| def a2 | |
| block = lambda { |x| return :a if x == 2 } | |
| [1,2,3].each(&block) |
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
| original: | |
| T1 ----- T2 ----- T3 ----- T4 | |
| \ | |
| ----- G1 ----- G2 | |
| after rcheckin, how it works now: | |
| T1 ----- T2 ----- T3 ----- T4 ----- G1' ----- G2' |
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
| // Given a class... | |
| class Thing | |
| { | |
| public string Value { get; set; } | |
| } |
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
| Error: | |
| test: Search should find conversation with attached text. (SearchTest): | |
| RSolr::Error::Http: RSolr::Error::Http - 500 Internal Server Error | |
| Error: org.apache.solr.core.SolrResourceLoader.getClassLoader()Ljava/lang/ClassLoader; | |
| java.lang.NoSuchMethodError: org.apache.solr.core.SolrResourceLoader.getClassLoader()Ljava/lang/ClassLoader; | |
| at org.apache.solr.handler.extraction.ExtractingRequestHandler.inform(ExtractingRequestHandler.java:95) | |
| at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.getWrappedHandler(RequestHandlers.java:244) | |
| at org.apache.solr.core.RequestHandlers$LazyRequestHandlerWrapper.handleRequest(RequestHandlers.java:231) | |
| at org.apache.solr.core.SolrCore.execute(SolrCore.java:1316) |