Coder Social home page Coder Social logo

intellitect / essentialcsharp.web Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 3.88 MB

The web side of essentialcsharp.com

Home Page: https://essentialcsharp.com/

C# 52.32% HTML 29.86% CSS 4.40% JavaScript 13.11% Dockerfile 0.30%
essentialcsharp hacktoberfest

essentialcsharp.web's Introduction

Install Instructions

  1. Add package to project from nuget.org. More instructions to get started with consuming nuget packages can be found on learn.microsoft.com
  2. All tools are under the IntelliTect.Multitool namespace.
  3. That's it! Please open an issue if you have any problems with any of these steps or have other questions.

ReleaseDateAttribute - Gets an UTC DateTime of compile time. Allows us to determine the build date/time

Blog Post/Additional Information: How To Display the Build Date of a .NET Application

Samples:

  • Assignment of GetReleaseDate() to a local variable

    DateTime? date = IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate(); // Returns a datetime in UTC to date
  • Displaying GetReleaseDate() on a cshtml page

    // This example is in cshtml.
    @IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate() // Returns a datetime in UTC
  • Converting and displaying GetReleaseDate() on a cshtml page

    // convert this UTC DateTime object into one for my local timezone that is formatted in a “d MMM, yyyy h:mm:ss tt” (ex: 8 Feb, 2023 11:36:31 AM).
    // The following code will format the date and convert it to my local time zone of Pacific Standard Time. 
    Build: @if (IntelliTect.Multitool.ReleaseDateAttribute.GetReleaseDate() is DateTime date)
    {
      @TimeZoneInfo.ConvertTimeFromUtc(date, TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time")).ToString("d MMM, yyyy h:mm:ss tt", CultureInfo.InvariantCulture)
    }
    // Result is "Build: 8 Feb, 2023 11:36:31 AM"

Miscellaneous Information:

  • To help hot reload in visual studio work properly, the release date attribute will be automatically be generated during compilation on a CI runner, but it won’t generate locally by default. If you want it to generate locally, set the ReleaseDateAttribute to true within a property group in your project file. (<ReleaseDateAttribute>true</ReleaseDateAttribute>)

RepositoryPaths - Provides consistent environment-independent normalized pathing within a git repository

Samples:

  • Get file path from the root of a repository

    // In this case, the GetDefaultRepoRoot() method can be used to get the root of a repository.
    string fullPathToTheFile = Path.Combine(IntelliTect.Multitool.RepositoryPaths.GetDefaultRepoRoot(), "TheFile.txt");

Security

  • ClaimsPrincipalExtensions: Extension methods to get a user ID and roles.
    • GetUserId
    • GetRoles

Extensions

  • StringExtensions: Extension methods for System.String
    • ValidateUrlString: Extension method to validate a URL string by checking to make sure the string is formatted correctly.
    • CreateUrlSlug: Extension method modify a string so that it is URL compatible
  • HttpExtensions: Extension methods for System.Net.Http.HttpClient ValidateUri: Extension methods to validate a Uri by attempting to make a GET request to it.
  • SystemLinqExtensions
    • WhereNotNull: Extension method to allow return of non-null value from a null object.
      • Sample:

        List<string?> listWithSomeNullValues = ["this", null, "is", null, "my", null, "favorite", null];
        List<string> listWithoutNullValues = listWithSomeNullValues.WhereNotNull().ToList();
        // returns ["this", "is", "my", "favorite"]
      • On:

        • System.Linq.Generic.IEnumerable<T>

Contributing

See the CONTRIBUTING.md file here.

If you have any problems, please feel free to check for existing issues or open a new issue.

essentialcsharp.web's People

Contributors

ascott18 avatar benjaminmichaelis avatar cosborn2 avatar cschadewitz avatar dependabot[bot] avatar devjohnevans avatar espence2003 avatar grantdwoods avatar keboo avatar kelseymcmahon avatar mikaellacroskrey-intellitect avatar twofingerrightclick avatar zackbward avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

essentialcsharp.web's Issues

Add Captcha to prevent/limit scraping

Have it pop up on some pages after a certain amount of time/number of pages navigated through to be completed before being able to see more content

Discuss how to better page navigation using keys without breaking normal highlighting functionality

Discussed in #245

Originally posted by YousefImran October 19, 2023
I will prefix this by saying I don't know much about the tool yet, so ignorance is present.
That being said, when I am typing notes on a highlight and trying to use the arrow keys (mainly left and right to move between letters) it seems that these keys have predefined functionality which is move between the highlights themselves or maybe move back and forth between the pages I am currently on.

Is there a way to avoid this? Maybe a setting or something where the arrow keys are just working within their context, as in, if the courser is on text, move between the text rather than move between notes or pages.

This has been very frustrating unfortunately and I appreciate any feedback.

Thank you.

Code block Fonts

I may have been unwise to use the all powerful selector html * for setting the font family to san serif as the selector code-line doesn't specify a font and so is using san-serif:
image

Either we should take advantage of inheritance (code-lines is parent of code-line and has serif font) by moving the san-serif font-family prop to the body tag selector (which will allow for inheritance, versus the html *), or add the mono-spaced font-family to the code-line selector. Either I think is fine.
image

Referrer Id's?

Be able to track how many people you've forwarded links to?

Add line numbers to listings

We should add line numbers to listing to make talking about the code in the listings easier. The line numbers should reflect the rendered lines not the source line numbers.

I don't think this is a valid command.

The second method uses the define command line. Output 4.27 demonstrates this with Dotnet command-line interface.

Output 4.27
>dotnet.exe -define:CSHARP2PLUS TicTacToe.cs

dotnet TicTacToe.cs cannot be used to compile the .cs source code, right?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.