Skip to content

Instantly share code, notes, and snippets.

View MoienTajik's full-sized avatar
👾

Moien Tajik MoienTajik

👾
View GitHub Profile
@MoienTajik
MoienTajik / TestController.cs
Created February 17, 2018 13:01
Using Google reCAPTCHA in ASP.NET MVC - Test Controller
public class TestController : Controller
{
[HttpGet]
public ActionResult Create()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
@MoienTajik
MoienTajik / Create.cshtml
Created February 17, 2018 13:03
Using Google reCAPTCHA in ASP.NET MVC - Create View
@using GoogleRecaptcha.Infrastructure.HtmlHelpers
@{
ViewBag.Title = "Create";
}
<h2>@ViewBag.Title</h2>
<h4>Some test form that needs reCAPTCHA !</h4>
<hr />

Keybase proof

I hereby claim:

  • I am MoienTajik on github.
  • I am moientajik (https://keybase.io/moientajik) on keybase.
  • I have a public key whose fingerprint is 2DD5 FC89 6B33 D440 B3AD E5DA 5E0E C9D1 C341 C464

To claim this, I am signing this object:

@MoienTajik
MoienTajik / ISO-639-1-language.json
Created August 19, 2018 12:48
ISO-639-1-language codes
[
{
"code": "ab",
"name": "Abkhaz"
},
{
"code": "aa",
"name": "Afar"
},
{
@MoienTajik
MoienTajik / ConstraintsList.md
Last active May 31, 2019 15:42
ASP.NET Core default Route Constraints list

ASP.NET Core default Route Constraints list

Constraints for Checking Data Type

The following Constrains checks the data type :

Constraint Inline Class Description
int {id:int} IntRouteConstraint Constrains a route parameter to represent only 32-bit integer values
alpha {id:alpha} AlphaRouteConstraint Constrains a route parameter to contain only lowercase or uppercase letters A through Z in the English alphabet.
bool {id:bool} BoolRouteConstraint Constrains a route parameter to represent only Boolean values.
@MoienTajik
MoienTajik / IClock.cs
Last active March 18, 2021 09:18
IClock abstracts DateTime & DateTimeOffset so you can easily mock time and unit-test.
public interface IClock
{
DateTimeOffset UtcNow { get; }
}
public static class Clock
{
private static IClock _instance = new SystemClock();
public static IClock Instance