Skip to content

Instantly share code, notes, and snippets.

View aodendaal's full-sized avatar

Andre Odendaal aodendaal

View GitHub Profile
@ramirezsandin
ramirezsandin / useRouterParams.ts
Last active November 12, 2024 07:10
React hook to be used with Next.js, it uses useRouter internally and offers some helper functions to manipulate the url query params.
import { useRouter } from "next/router";
import { ParsedUrlQuery } from "querystring";
interface UseRouterParamsOptions {
method?: "push" | "replace";
shallow?: boolean;
}
const useRouterParams = (options?: UseRouterParamsOptions) => {
const { query, pathname, push, replace } = useRouter();
public class SetLowRez : MonoBehaviour
{
[SerializeField] protected bool doOnAwake = true;
[SerializeField] protected int xRes = 64, yRes = 64;
private int bigXRes, bigYRes;
private bool isLowRes;
private void SetSmallResolution()
@Hertzole
Hertzole / DebugRuntimeConsole.cs
Last active July 6, 2023 09:04
A console for Unity runtime that shows all console messages (Debug.Log, exceptions, etc)
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;
public class DebugRuntimeConsole : MonoBehaviour
{
/// <summary>
/// A struct to hold all the info about a debug message.
/// </summary>