This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MONGODB_ROOT_USERNAME="YOUR_USERNAME_HERE" | |
MONGODB_ROOT_PASSWORD="YOUR_PASSWORD_HERE" | |
# Use `openssl rand -base64 756` to generate a valid MongoDB key. | |
MONGO_REPLICA_SET_KEY="YOUR_REPLICA_SET_KEY_HERE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ACCEPT_LANGUAGE_REGEX = | |
/(?<code>[a-zA-Z]{1,8})(?:-(?<region>[a-zA-Z]{1,8}))?(?:;q=(?<quality>0\.\d+|\d))?/g; | |
type Language = { | |
code: string; | |
region?: string; | |
quality: number; | |
}; | |
export default function parseAcceptLanguage(header: string): Array<Language> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { browser } from "$app/environment"; | |
export default function formatDateTime(dateTime: Date): string { | |
return browser && window.navigator | |
? new Intl.DateTimeFormat(window.navigator.language, { | |
dateStyle: "long", | |
timeStyle: "short", | |
}).format(dateTime) | |
: dateTime.toLocaleString(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script lang="ts"> | |
import { page } from "$app/stores"; | |
export let title: string = ""; | |
export let type: string = ""; | |
export let image: string = ""; | |
export let url: string = $page.url.pathname; | |
export let description: string = ""; | |
export let siteName: string = ""; | |
export let twitter: string = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default async function formDataToObject( | |
formData: Promise<FormData> | FormData, | |
): Promise<Record<string, unknown>> { | |
const object: Record<string, unknown> = {}; | |
for (const [key, value] of await Promise.resolve(formData)) { | |
const property = object[key]; | |
if (property === undefined) { | |
object[key] = value; | |
} else if (Array.isArray(property)) { | |
property.push(value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const NON_ALPHANUMERIC_REGEX = /[^a-z0-9]+/g; | |
const LEADING_TRAILING_DASHES_REGEX = /^-+|-+$/g; | |
export default function slugify(title: string): string { | |
return title | |
.toLowerCase() | |
.replace(NON_ALPHANUMERIC_REGEX, "-") | |
.replace(LEADING_TRAILING_DASHES_REGEX, ""); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using FishNet.Object; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System; | |
using UnityEditor; | |
using UnityEngine; | |
using System.Collections; | |
using System.Linq; | |
using FishNet.Object.Synchronizing; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rewrite non /app/build/ requests to /app/build/ | |
RewriteCond %{REQUEST_URI} !^/app/build/ | |
RewriteRule ^(.*)$ /app/build/$1 [L] | |
# Rewrite requests to non-existing files/dirs to /app/build/index.html | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public sealed class NoClip : MonoBehaviour | |
{ | |
[SerializeField] private float radius; | |
[SerializeField] private float distance; | |
[SerializeField] private AnimationCurve offsetCurve; | |
[SerializeField] private LayerMask clippingLayerMask; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public sealed class SimpleCharacterController : MonoBehaviour | |
{ | |
[SerializeField] private float speed; | |
[SerializeField] private float jumpSpeed; | |
private Vector3 _velocity; | |
[SerializeField] private CharacterController characterController; |
NewerOlder