Skip to content

Instantly share code, notes, and snippets.

@yigith
yigith / react-checklist-en.md
Last active January 5, 2024 14:55 — forked from marko-knoebl/react-checklist-en.md
A checklist for learning React - Fork it and start ticking off topics!

React topics checklist

A checklist for learning React - Fork it and start ticking off topics!

React fundamentals

  • use-cases of React
  • JavaScript basics for React
    • immutability / data management without mutations
  • updating properties of objects
@yigith
yigith / pagination.cs
Created January 28, 2021 08:45
Pagination Numbers (C#)
// https://gist.github.com/kottenator/9d936eb3e4e3c3e02598
public static int[] Pagination(int current, int last)
{
int delta = 2;
int left = current - delta;
int right = current + delta + 1;
var range = new List<int>();
var rangeWithDots = new List<int>();
int? l = null;
@yigith
yigith / gist:81acabcd74829d1051ebb871ff4f9f4d
Created January 28, 2021 08:03
Create Pagination Numbers
// https://gist.github.com/kottenator/9d936eb3e4e3c3e02598
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
@yigith
yigith / HomeController.cs
Created December 25, 2019 13:52 — forked from pauldotknopf/HomeController.cs
Render .NET Core ASP.NET MVC ViewComponent to string from controller
public class HomeController : Controller
{
public async Task<string> RenderViewComponent(string viewComponent, object args)
{
var sp = HttpContext.RequestServices;
var helper = new DefaultViewComponentHelper(
sp.GetRequiredService<IViewComponentDescriptorCollectionProvider>(),
HtmlEncoder.Default,
sp.GetRequiredService<IViewComponentSelector>(),