Skip to content

Instantly share code, notes, and snippets.

@emmapersky
emmapersky / gist:1067947
Created July 6, 2011 18:22
Adding regular expression table matching to SeqelPro
Index: Source/SPTablesList.m
===================================================================
--- Source/SPTablesList.m (revision 3349)
+++ Source/SPTablesList.m (working copy)
@@ -1812,8 +1812,13 @@
for (i = 0; i < [tables count]; i++) {
tableType = [[tableTypes objectAtIndex:i] integerValue];
if (tableType == SPTableTypeNone) continue;
- substringRange = [[tables objectAtIndex:i] rangeOfString:[listFilterField stringValue] options:NSCaseInsensitiveSearch];
- if (substringRange.location == NSNotFound) continue;
CONTENT_TYPES = {:html => 'text/html', :css => 'text/css', :js => 'application/javascript'}
before do
request_uri = case request.env['REQUEST_URI']
when /\.css$/ : :css
when /\.js$/ : :js
else :html
end
content_type CONTENT_TYPES[request_uri], :charset => 'utf-8'
end