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
| # access these directory shortcuts | |
| # with ~rails, ~beast, etc | |
| p=~/p | |
| w=~/w | |
| rails=~/p/rails/git | |
| todo=~/Documents/todo | |
| # Input stuff. | |
| bindkey -e |
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 Status < ActiveRecord::Base | |
| can_search do | |
| scoped_by :user | |
| scoped_by :created, :scope => :date_range | |
| end | |
| # user_id can be an integer or nil | |
| def self.filter(user_id, filter, options = {}) | |
| # filter can be :daily, :monthly, etc, | |
| # see DateRangeScope in can_serach plugin |
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
| diff --git a/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/delta.rb b/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/delta.rb | |
| index 88da2bd..20c4570 100644 | |
| --- a/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/delta.rb | |
| +++ b/vendor/plugins/thinking-sphinx/lib/thinking_sphinx/active_record/delta.rb | |
| @@ -85,7 +85,9 @@ module ThinkingSphinx | |
| {self.id => 1} | |
| ) if self.in_core_index? | |
| - system "indexer --config #{config.config_file} --rotate #{self.class.indexes.first.name}_delta" | |
| + cmd = "indexer --config #{config.config_file} --rotate #{self.class.indexes.first.name}_delta" |
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
| // Beginning of a Ubiquty script for use with xtt | |
| CmdUtils.CreateCommand({ | |
| name: "xtt", | |
| takes: {status: noun_arb_text}, | |
| preview: function(previewBlock, statusText) { | |
| var previewTemplate = "Updates your XTT status to: <br/>" + | |
| "<b>${status}</b><br /><br />"; | |
| var previewData = { |
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
| /* | |
| ============= | |
| ai_walk | |
| The monster is walking it's beat | |
| ============= | |
| */ | |
| void ai_walk (edict_t *self, float dist) | |
| { | |
| M_MoveToGoal (self, dist); |
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 nuke_terminator(pid) | |
| Process.kill("KILL", pid) rescue nil | |
| Process.wait(pid) rescue nil | |
| end | |
| # OR | |
| def nuke_terminator(pid) | |
| Process.kill("KILL", pid) | |
| Process.wait(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
| >> class Oo | |
| >> def O *args | |
| >> raise *args | |
| >> end | |
| >> end | |
| => nil | |
| >> class Object | |
| >> def o | |
| >> Oo.new | |
| >> 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
| task :write_memcache_config, :roles => :app, :except => {:no_release => true, :no_symlink => true} do | |
| get("#{shared_path}/config/memcached.yml.tmpl", 'memcached.yml.tmpl') | |
| template = IO.read "memcached.yml.tmpl" | |
| File.unlink "memcached.yml.tmpl" | |
| put template.sub(/%NAMESPACE%/, "lh#{File.basename latest_release}"), "#{release_path}/config/memcached.yml", :mode => 0644 | |
| end | |
| task :lh_custom, :roles => :app, :except => {:no_release => true, :no_symlink => true} do | |
| write_memcache_config | |
| # other custom crap |
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 ActiveRecord::Base | |
| @@cache_store = nil | |
| def self.cache_store | |
| @@cache_store ||= ActionController::Base.cache_store | |
| end | |
| def self.caches(method_name, key = nil, options = {}, &block) | |
| if key.is_a?(Hash) | |
| options = key | |
| key = nil |
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 << Addressable::URI | |
| # ActionController::Routing passes an unsafe char regex to URI.escape. However, | |
| # Addressable::URI.escape has the correct unsafe char regexes for each url part. | |
| def escape(uri, whatever) | |
| encode(uri) | |
| end | |
| end |
OlderNewer