Skip to content

Instantly share code, notes, and snippets.

View TirthakShahDev's full-sized avatar

Tirthak Shah TirthakShahDev

View GitHub Profile
@TirthakShahDev
TirthakShahDev / inject.js
Last active March 27, 2022 05:59
GeeksForGeeks Disable Login Popup Chrome Extension 🚀
(function() {
localStorage.removeItem("gfgViewCount")
})();
@TirthakShahDev
TirthakShahDev / index.html
Created March 6, 2022 21:27
Poor Man's React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="./script.js" type="text/babel"></script>
</head>
@TirthakShahDev
TirthakShahDev / Model.cs
Created November 23, 2018 11:41
Restrict Special Characters Attribute
[RestrictSpecialCharacters]
public string BookName { get; set; }
public static class MvcBeginForm
{
public static MvcForm HtmlBeginSecureForm(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues)
{
var form = htmlHelper.BeginForm(actionName, controllerName);
htmlHelper.ViewContext.Writer.Write(htmlHelper.AntiForgeryToken().ToHtmlString());
return form;
}
public static MvcForm HtmlBeginSecureForm(this HtmlHelper htmlHelper, string actionName, string controllerName)
//FilterProviders.Providers.Add(new AntiforgeryTokenFilter()); Add this to filterproviders
public class AntiforgeryTokenFilter : IFilterProvider
{
public IEnumerable<Filter> GetFilters(ControllerContext controllerContext, ActionDescriptor actionDescriptor)
{
List<Filter> filterSet = new List<Filter>();
// ValidateAntiForgeryToken for POST requests +
// Skip Actions with UnValidateAntiForgeryToken
string verb = controllerContext.HttpContext.Request.HttpMethod;
@TirthakShahDev
TirthakShahDev / bootstrap-equal-height.css
Created March 15, 2018 12:13 — forked from itsjavi/bootstrap-equal-height.css
Bootstrap 3 responsive equal height columns
/* From: http://www.minimit.com/articles/solutions-tutorials/bootstrap-3-responsive-columns-of-same-height */
/* columns of same height styles */
.container-xs-height {
display:table;
padding-left:0px;
padding-right:0px;
}
.row-xs-height {
display:table-row;