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
| private static IEnumerable<Type> GetTypesInDirectoryWithExtension(string path, string extension) | |
| { | |
| foreach (FileInfo file in new DirectoryInfo(path).GetFiles(extension, SearchOption.AllDirectories)) | |
| { | |
| Type[] types = null; | |
| try | |
| { | |
| Assembly a = Assembly.LoadFrom(file.FullName); | |
| types = a.GetTypes(); |
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
| [Serializable] | |
| public class Cache<TKey, TValue> : IIndexer<TKey, TValue> where TValue : class | |
| { | |
| readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(); | |
| readonly IDictionary<TKey, TValue> _values; | |
| Func<TValue, TKey> _getKey = delegate { throw new NotImplementedException(); }; | |
| Action<TValue> _onAddition = x => { }; | |
| Func<TKey, TValue> _onMissing = delegate(TKey key) |
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
| routes.MapRouteTo<DiagnosticsController>(Urls.root.debug, x => x.Index()); | |
| routes.MapRouteTo<DiagnosticsController>(Urls.root.diagnostics.ok, x => x.Ok()); | |
| routes.MapRouteTo<DiagnosticsController>(Urls.root.diagnostics.raise, x => x.Raise()); | |
| routes.MapRouteTo<LoginController>(Urls.root.login, x => x.Login(null)); | |
| routes.MapRouteTo<LoginController>(Urls.root.logout, x => x.Logout()); | |
| routes.MapRouteTo<StyleguideController>(Urls.root.styleguide, x => x.Styleguide()); |
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
| # Needs Ruby 1.8.7 | |
| # gem install hipchat | |
| # gem install xmpp4r-simple | |
| # gem install daemons | |
| # run with ruby zen_to_hipchat.rb start | |
| require 'rubygems' | |
| require 'hipchat' | |
| require 'xmpp4r-simple' |
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
| <%= semantic_form_for @decision do |form| %> | |
| <%= form.inputs(:name => "Questions", :for => :answer_to_questions) do |field| %> | |
| <%= field.input :decision_question_id, :as => :hidden %> | |
| <%= field.input :decision_answer, :as => :radio, :collection => field.object.decision_question.decision_answers, :label => field.object.decision_question.text %> | |
| <% end %> | |
| <%= form.inputs do %> | |
| <%= form.input :category_id, :as => :hidden %> | |
| <% end %> | |
| <%= form.buttons do %> |
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
| # Needs Ruby 1.8.7 | |
| # gem install hipchat | |
| # gem install xmpp4r-simple | |
| # gem install daemons | |
| # run with ruby zentc_to_hipchat.rb start | |
| require 'rubygems' | |
| require 'hipchat' | |
| require 'xmpp4r-simple' |
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 'spec_helper' | |
| #Note that while this spec is quite sexy, it shouldn't be taken too far | |
| #this syntax hides deeper meaning that may very well be important. | |
| #I'm using this for a quick spike and I think it's acceptable in certain | |
| #scenarios, but use with caution! Don't get distracted by the shiny... | |
| describe User do | |
| its(:user_profile) { should be } | |
| 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
| group :development, :test do | |
| # gem 'webrat' | |
| gem 'autotest-rails' | |
| gem 'autotest-growl' | |
| gem "rspec-core", :git => "git://github.com/rspec/rspec-core.git" | |
| gem "rspec-rails", '~> 2.4.1' | |
| gem 'rr' | |
| gem "spork", :git => "git://github.com/timcharper/spork.git" | |
| gem "guard-spork" | |
| gem "rb-fsevent" |
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
| # A sample Guardfile | |
| # More info at http://github.com/guard/guard#readme | |
| guard 'spork' do | |
| watch('^config/application.rb$') | |
| watch('^config/environment.rb$') | |
| watch('^config/environments/.*\.rb$') | |
| watch('^config/initializers/.*\.rb$') | |
| watch('^spec/spec_helper\.rb$') | |
| watch('^spec/factories\.rb$') |
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
| Autotest.add_hook(:initialize) {|at| | |
| %w{.git .svn .hg .swp .DS_Store ._* tmp}.each do |exception| | |
| at.add_exception(exception) | |
| end | |
| at.clear_mappings # take out the default (test/test*rb) | |
| at.add_mapping(%r%^(spec|third_party)/.*_spec.rb$%) { |filename, _| | |
| filename | |
| } |
OlderNewer