Skip to content

Instantly share code, notes, and snippets.

@mt89vein
mt89vein / CookieHelper.cs
Last active August 28, 2024 13:08
A cookies helper class to easily read and set cookies on HttpRequest (Asp.Net Core)
/// <summary>
/// Вспомогательные методы для работы с <see cref="Cookie"/>.
/// </summary>
public static class CookiesHelper
{
#region Методы (public)
/// <summary>
/// Получить список куки, которые сервер хочет установить через Set-Cookie.
/// </summary>
@vlasky
vlasky / point_in_polygon_using_winding_number.js
Last active June 21, 2024 07:00
JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon
//JavaScript implementation of winding number algorithm to determine whether a point is inside a polygon
//Based on C++ implementation of wn_PnPoly() published on http://geomalgorithms.com/a03-_inclusion.html
function pointInPolygon(point, vs) {
const x = point[0], y = point[1];
let wn = 0;
for (let i = 0, j = vs.length - 1; i < vs.length; j = i++) {
let xi = vs[i][0], yi = vs[i][1];
let xj = vs[j][0], yj = vs[j][1];