- Is the code located such that reading at one location is sufficient to understand it? Or is it located in many locations?
- Is there any external documentation (wiki, onenote or word files)?
- Use of libraries with intuitive API
- wiki
- readme
| Namespace ProjectWithSwagger | |
| { | |
| public class Startup | |
| { | |
| // This method gets called by the runtime. Use this method to add services to the container | |
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| //.... | |
| services.ConfigureSwaggerGen(swaggerGen => | |
| { |
| using System; | |
| using NUnit.Framework; | |
| namespace Tests | |
| { | |
| [TestFixture] | |
| public class Uri_trycreate_can_do_path_combine | |
| { | |
| public static Uri ToUri(string baseUrl, string path) | |
| { |
| let verboseBuild verbosity (defaults:MSBuildParams)= | |
| { defaults with Verbosity = Some(verbosity) } | |
| let quietBuild = verboseBuild Quiet | |
| let withTargets targets (defaults:MSBuildParams)= | |
| { defaults with Targets = targets } | |
| let rebuildBuild = withTargets ["ReBuild"] | |
| let buildModeConfiguration buildMode (defaults:MSBuildParams)= | |
| { defaults with | |
| Properties = |
| /// <summary> | |
| /// Decompose a flags enum value into the individual flags. | |
| /// </summary> | |
| public static T[] DeComposeFlags<T>(Enum value) | |
| { | |
| var defaultV = default(T); | |
| return Enum.GetValues(typeof(T)) | |
| .Cast<Enum>() | |
| .Where(e=> !defaultV.Equals(e) && value.HasFlag(e)) | |
| .Cast<T>() |
| #!/bin/sh | |
| EXEC="exec " | |
| MONO="/Library/Frameworks/Mono.framework/Commands/mono" | |
| if test x"$1" = x--debug; then | |
| DEBUG=--debug | |
| shift | |
| fi | |
| if test x"$1" = x--gdb; then |
| let r = [0;1;2;3] | |
| let stitch s= | |
| let head = s |> Seq.head | |
| let tail = s |> Seq.skip 1 | |
| tail |> Seq.scan (fun state elem-> (snd state, elem)) (head, head) | |
| |> Seq.skip 1 | |
| |> Seq.toList | |
| open System.Linq |
| require 'visual_studio_files' # https://rubygems.org/gems/visual_studio_files | |
| desc "regenerate links in project X" | |
| task :regen_links do | |
| project_y = VisualStudioFiles::CsProj.new(File.open(File.join($dir,'ProjectY','ProjectY.csproj'), "r").read) | |
| project_y_files = v.files.select do |file| | |
| file.type=='Compile' && !file.file.end_with?('AssemblyInfo.cs') | |
| end | |
| project_x = VisualStudioFiles::CsProj.new(File.open(File.join($dir,'ProjectX','ProjectX.csproj'), "r").read) | |
| project_x.clear_links |
| In Ruby 1.9.2 to escape XML special characters in Strings, use the 'encode' method. | |
| Example, if you have: | |
| my_string = 'this is "my" complicated <String>' | |
| For XML attributes use: | |
| "<node attr=#{my_string.encode(:xml => :attr)} />" | |
| Generates: |