🏳️🌈
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
<target name="compress.css" verbose="true" description="compress the css files"> | |
<foreach item="File" property="file.path"> | |
<in> | |
<items> | |
<include name="css\*.css" /> | |
</items> | |
</in> | |
<do> | |
<property name="filename" value="css\${path::get-file-name(file.path)}" /> | |
<exec program="java" commandline="-jar ${tools}\YUICompressor\build\yuicompressor-2.4.2.jar --type css -o ${filename} ${filename}" /> |
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
module AttrMethods | |
class << Object | |
@@array_methods = {} | |
@@hash_methods = {} | |
def attr_array(*method_names) | |
@@array_methods[self] = method_names | |
end | |
def attr_hash(*method_names) | |
@@hash_methods[self] = method_names |
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
# the verbose, annoying to maintain way :( | |
module MyModule | |
@@my_attribute = nil | |
def MyModule.my_attribute=(value) | |
@@my_attribute = value | |
end | |
def MyModule.my_attribute |
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 static class ServiceBusExtensions | |
{ | |
public static bool HasSubscribersFor<T>(this IServiceBus serviceBus, T message) | |
{ | |
IEnumerable<Action<object>> enumerable = serviceBus.OutboundPipeline.Enumerate(message); | |
return enumerable.Count() > 0; | |
} | |
} |
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 Symbol | |
def to_setting | |
self.to_s.gsub("_", " ").gsub(/\b\w/){$&.upcase}.gsub(" ", "") | |
end | |
end | |
:output_dir.to_setting #=> "OutputDir" |
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::log_level = :verbose | |
class MSBuild | |
attr_array :parameters | |
def run_command(command_name="", command_parameters="") | |
command_parameters += " #{@parameters.join(' ')}" | |
super(command_name, command_parameters) | |
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
nunit :unittests do |nunit| | |
#you can set the working directory using nunit.command_directory - poorly named, i know. will fix that in next release. | |
nunit.command_directory = "src/tests/bin/release/" | |
#note: the path_to_command is relative to the working directory | |
nunit.path_to_command = "../../../../nunit/nunit-console.exe" | |
#note: the path to the assemblies is also relative to the working directory | |
nunit.assemblies "tests.dll" | |
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 SomeNewCode | |
{ | |
private ISomeOldCode {get; set; } | |
public SomeNewCode(ISomeOldCode someOldCode) | |
{ | |
SomeOldCode = someOldCode; | |
} | |
} | |
public interface ISomeOldCode |
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' | |
task :default => [:buildall] | |
task :buildall do | |
FileList.new("./**/*.sln").each do |sln| | |
msbuild "build_#{sln}", [:solution] do |msb, args| | |
msb.solution = args.solution | |
msb.targets :clean, :build |