View gist:8ebf7020d4ee8e709e6034f6aef5f024
This file contains 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
# vim: noexpandtab tabstop=2 shiftwidth=2 softtabstop=2 commentstring=#\ %s | |
# This is a repro case for the commentary plugin dealing with commenting visual | |
# blocks in which there is an existing "empty" comment. I am expecting to be | |
# able to comment all lines of the `resource` block. | |
# If I place my cursor on `resource` and pressing `VGgc` then | |
# there is no space between `resource` and the new comment hash at the | |
# beginning of the line. |
View abbreviated exportOptionsPlist file
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>provisioningProfiles</key> | |
<!-- THIS SHOULD HAVE BEEN A DICT: --> | |
<string>90064_appcl0XL8guBT_DIST.mobileprovision</string> | |
</dict> | |
</plist> |
View congress_bill_transitions.rb
This file contains 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 'set' | |
require 'pp' | |
require 'json' | |
require 'date' | |
require 'bigdecimal' | |
module BillStateGraphs | |
class BillAction | |
attr_accessor :acted_at |
View search.cc
This file contains 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
void Search::execute(){ | |
size_t num_results=registry_->getNumResults(); | |
size_t count=0; | |
registry_->getPostings()->searchIndex(*this); | |
for(inverted_search_t::iterator it2=pruned_results.begin(),ite2=pruned_results.end();(it2!=ite2) && (count<num_results);++it2){ | |
DocumentPtr other=registry_->getDocumentManager()->getDocument(it2->second.doc_type,it2->second.doc_id,DocumentManager::META); | |
AssociationPtr association(new Association(registry_,doc,other)); | |
performance->add(association->getInstrument()); | |
if (association->getResultCount()>0){ | |
associations.push_back(association); |
View update_index.py
This file contains 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 do_update(backend, index, qs, start, end, total, verbosity=1): | |
# Get a clone of the QuerySet so that the cache doesn't bloat up | |
# in memory. Useful when reindexing large amounts of data. | |
small_cache_qs = qs.all() | |
current_qs = small_cache_qs[start:end] | |
if verbosity >= 2: | |
if os.getpid() == os.getppid(): | |
print " indexed %s - %d of %d." % (start+1, end, total) | |
else: |
View gist:663215
This file contains 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
175c175 | |
< def clear(self): | |
--- | |
> def clear(self, extra_headers=None): | |
180a181,182 | |
> if extra_headers: | |
> self._headers.update(extra_headers) | |
578c580 | |
< def send_error(self, status_code=500, **kwargs): | |
--- |
View gist:663167
This file contains 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 send_error(self, status_code=500, **kwargs): | |
"""Sends the given HTTP error code to the browser. | |
We also send the error HTML for the given error code as returned by | |
get_error_html. Override that method if you want custom error pages | |
for your application. | |
""" | |
if self._headers_written: | |
logging.error("Cannot send error response after headers written") | |
if not self._finished: |