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
User.username_equals("ben") |
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
# lib/searchlogic/named_scopes/conditions.rb | |
def method_missing(name, *args, &block) | |
if details = condition_details(name) | |
create_condition(details[:column], details[:condition], args) | |
send(name, *args) | |
elsif boolean_condition?(name) | |
column = name.to_s.gsub(/^not_/, "") | |
named_scope name, :conditions => {column => (name.to_s =~ /^not_/).nil?} | |
send(name) | |
else |
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
# lib/searchlogic/core_ext/object.rb | |
def searchlogic_lambda(type = :string, options = {}, &block) | |
proc = lambda(&block) | |
proc.searchlogic_options ||= {} | |
proc.searchlogic_options[:type] = type | |
proc.searchlogic_options.merge!(options) | |
proc | |
end |
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
# lib/searchlogic/named_scopes/conditions.rb | |
def create_primary_condition(column, condition) | |
... | |
named_scope("#{column}_#{condition}".to_sym, scope_options) | |
end |
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
# lib/searchlogic/named_scopes/conditions.rb | |
def method_missing(name, *args, &block) | |
... | |
send(name, *args) | |
... | |
end |
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
User.send(:username_equals, "ben") |
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
User.username_equals("ben") |
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
var fs = require('fs') | |
, path = require('path') | |
, _ = require('underscore'); | |
var rootPath = "/path/to/remove"; | |
removeDirForce(rootPath); | |
// path should have trailing slash | |
function removeDirForce(dirPath) { | |
fs.readdir(dirPath, function(err, files) { |
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
Statistical profiling result from profile-12980120047188966.log, (1058 ticks, 3 unaccounted, 0 excluded). | |
[Unknown]: | |
ticks total nonlib name | |
3 0.3% | |
[Shared libraries]: | |
ticks total nonlib name | |
59 5.6% 0.0% 00ada000-00adb000 |
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
diff --git a/ruby-mode/ruby-mode.el b/ruby-mode/ruby-mode.el | |
index 94cb9ab..d810146 100644 | |
--- a/ruby-mode/ruby-mode.el | |
+++ b/ruby-mode/ruby-mode.el | |
@@ -350,7 +350,7 @@ Also ignores spaces after parenthesis when 'space." | |
((forward-char))))) | |
(insert coding-system))) | |
((looking-at "\\s *#.*coding\\s *[:=]")) | |
- (t (insert "# -*- coding: " coding-system " -*-\n")) | |
+ (t (insert "")) |