Skip to content

Instantly share code, notes, and snippets.

@haizaar
haizaar / google_auth_utils.py
Last active July 29, 2022 21:23
Google Auth Utils for Directory API
import subprocess
import warnings
from typing import List, Optional
import google.auth
import google.auth.iam
import google.oauth2.credentials
import structlog
from google.auth.credentials import Credentials
from google.auth.transport import requests
@GiriB
GiriB / inside.poly.lua
Created June 25, 2016 08:01
"Ray Casting Method" to find if a point in a polygon in lua
-- Port of http://www.ariel.com.au/a/python-point-int-poly.html in lua
-- # Determine if a point is inside a given polygon or not
-- # Polygon is a list of (x,y) pairs. This function
-- # returns True or False. The algorithm is called
-- # the "Ray Casting Method".
function point_inside_poly(x,y,poly)
-- poly is like { {x1,y1},{x2,y2} .. {xn,yn}}
-- x,y is the point
local inside = false