Skip to content

Instantly share code, notes, and snippets.

@unitycoder
unitycoder / GeometryUtils.cs
Last active April 24, 2024 03:34
Unity Math & Geometry Utility : ShortestAngleDistance, IsAxisAligned, FindClosestEdge, PointOnOppositeSideOfPolygon, TriangulatePolygon, ClosestTimesOnTwoLines, ClosestPointsOnTwoLineSegments, ClosestPointOnLineSegment, ClosestPolygonApproach, PointInPolygon, ProjectPointOnPlane, OrientedMinimumBoundingBox2D, PolygonsWithinRange, PolygonVertexTo…
// source: https://docs.unity3d.com/Packages/com.unity.xrtools.utils@1.4/api/Unity.XRTools.Utils.GeometryUtils.html
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Unity.XR.CoreUtils
{
/// <summary>
/// Utility methods for common geometric operations
@rxaviers
rxaviers / gist:7360908
Last active April 24, 2024 03:33
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@etoxin
etoxin / git.md
Last active April 24, 2024 03:33
GIT Bash Commands

search (regex)

git grep "regex"

list all branches

git branch -a
@fredjoseph
fredjoseph / Zsh.md
Last active April 24, 2024 03:32
Zsh

Config files

To configure Zsh for your user’s session, you can use the following files:

  • $ZDOTDIR/.zshenv
  • $ZDOTDIR/.zprofile
  • $ZDOTDIR/.zshrc
  • $ZDOTDIR/.zlogin
  • $ZDOTDIR/.zlogout

By default, Zsh will try to find the user’s configuration files in the $HOME directory. You can change it by setting the environment variable $ZDOTDIR.

@gauchy
gauchy / notion2Habitica.py
Last active April 24, 2024 03:31
Notion to Habitica Sync tool
import requests, json
#Notion's token and databaseId
token = 'XXX'
databaseId = 'XXX'
#Notion's headers
headers = {
"Authorization": "Bearer " + token,
"Content-Type": "application/json",
@ejdoh1
ejdoh1 / macos-webcam-rtsp.sh
Last active April 24, 2024 03:29
MacOS webcam RTSP server & client
# local
ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" -preset ultrafast -tune zerolatency -f mpegts udp://127.0.0.1:9090
ffplay -fflags nobuffer -flags low_delay -framedrop -strict experimental udp://127.0.0.1:9090
# remote
ffmpeg -f avfoundation -framerate 30 -video_size 640x480 -i "0:none" -preset ultrafast -tune zerolatency -f flv rtmp://REPLACEME.australiaeast.azurecontainer.io/live/test
ffplay -fflags nobuffer -flags low_delay -framedrop -strict experimental rtmp://REPLACEME.australiaeast.azurecontainer.io/live/test
@psaikali
psaikali / acf-gravity-forms-field.php
Created January 4, 2019 13:43
Populate ACF select field options with Gravity Forms to select a specific form
<?php
/**
* Populate ACF select field options with Gravity Forms forms
*/
function acf_populate_gf_forms_ids( $field ) {
if ( class_exists( 'GFFormsModel' ) ) {
$choices = [];
foreach ( \GFFormsModel::get_forms() as $form ) {
$choices[ $form->id ] = $form->title;
@henrik242
henrik242 / airtag-to-gpx-sync.sh
Last active April 24, 2024 03:27
Read AirTag data from the FindMy.app cache and convert to GPX
#!/usr/bin/env bash
#
# Reads AirTag data from the FindMy.app cache and converts it to a daily GPX file
#
# Rsyncs the data to a web accessible folder that can be displayed with e.g.
# https://gist.github.com/henrik242/84ad80dd2170385fe819df1d40224cc4
#
# This should typically be run as a cron job
#
<#
.SYNOPSIS
To import registry (.reg) file using pure PowerShell.
.DESCRIPTION
Intended Use
This script was produced to assist with importing registry (.reg) files where the registry
handlers, such as reg.exe or regedit.exe, are blocked from executing.
@Whip
Whip / https-on-localhost.md
Last active April 24, 2024 03:24 — forked from adnan360/https-on-localhost.md
Use HTTPS on Localhost (XAMPP, Windows)

This has been tested with XAMPP (PHP 8.2) on Windows 11.

STEP 1: Editing Configs

Open php.ini by clicking Config button on the Xampp control panel

In this ini file semi colon (;) is used to comment a line. We want to use openssl library, so we have to make sure the line for openssl is not commented.

Remove semi colon (;) in front of this line, if there is any: