🏳️🌈
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
Component(d => d.Detail, m => | |
{ | |
m.Access.AsCamelCaseField(Prefix.Underscore); | |
m.Map(d => d.Destination); | |
m.Component(o => o.Override, overrideMap => | |
{ | |
overrideMap.Map(o => o.OverridenBy).Access.AsProperty(); | |
overrideMap.Map(o => o.DateOfOverride).Access.AsProperty(); | |
}).Access.AsProperty(); | |
}); |
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
FluentConfiguration fluentConfig = Fluently.Configure() | |
.Database(SQLiteConfiguration.Standard.ConnectionString(c => c.Is("conn string"))) | |
.Mappings(m => m.FluentMappings | |
.ConventionDiscovery.Add(DefaultLazy.AlwaysFalse()) | |
.AddFromAssemblyOf<UserMap>() | |
); | |
Configuration configuration = fluentConfig.BuildConfiguration(); | |
return configuration; |
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 build_options(option_name, option_values={}) | |
if (option_values.length > 0) | |
option_text = "/#{option_name}:" | |
if (option_values.kind_of?(Hash)) | |
option_text << process_hash(option_values) | |
else | |
option_text << process_array(option_values) | |
end | |
option_text = option_text.chop | |
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
def build_hash_options(option_name, option_values={}) | |
return if (option_values.length==0) | |
option_text = "/#{option_name}:" | |
option_values.each do |key, value| | |
option_text << "#{key}\=#{value};" | |
end | |
option_text = option_text.chop | |
option_text |
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
class Hash | |
def build_parameters | |
option_text = '' | |
self.each do |key, value| | |
option_text << "#{key}\=#{value};" | |
end | |
option_text.chop | |
end | |
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
#........... in my 'patches' folder | |
module HashParameterBuilder | |
def build_parameters | |
option_text = '' | |
self.each do |key, value| | |
option_text << "#{key}\=#{value};" | |
end | |
option_text.chop | |
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
desc "Run a sample build using the MSBuildTask" | |
Rake::MSBuildTask.new(:msbuild) do |msb| | |
# ... other stuff set, here | |
#if you want extended debugging info, set the log_level to :verbose | |
#defaults to not being verbose mode and only basic messages are shown | |
msb.log_level = :verbose | |
#if you want to set a specific IO device for the log messages, set here | |
#defaults to STDIO |
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 'singleton' | |
class BlockTest | |
def test | |
puts "this is the real method." | |
yield if block_given? | |
end | |
end | |
class Object |
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 'albacore' | |
Albacore::ExpandTemplatesTask.new(:templates) do |templates| | |
templates.expand_files = {"./templates/web.config.template" => "./www/web.config"} | |
templates.data_file = "./templates/data/web.config.yml" | |
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
public class AppController: IApplicationController | |
{ | |
//other app controller stuff here | |
public R Query<T,R>(T queryData) | |
{ | |
R returnValue = default(R); | |
IQuery<T,R> query = iocContainer.GetInstance<IQuery<T,R>>(); | |
if (query != null) | |
returnValue = query.Query(T); |
OlderNewer