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 { Component, Input } from '@angular/core'; | |
const currencyPattern = /^([\D\s]+?)(?=[+-\d])/; | |
const trailingZeroesPattern = /(,|.)00$/; | |
@Component({ | |
selector: 'price', | |
template: '{{ formattedPrice }}', | |
styles: [':host { vertical-align: middle; }'] | |
}) |
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
# On the server use the htpasswd command to generate a hashed login: | |
# $ htpasswd -c ~/domains/{domainname}/.htpasswd {username} | |
# then input a secret password. | |
<If "req('Host') == '{domainname}.wiredev.nl'"> | |
AuthType Basic | |
AuthUserFile ~/domains/{domainname}.wiredev.nl/.htpasswd/.htpasswd | |
AuthName "Acceptance" | |
# Make an exception for the letsencrypt folder | |
Require expr %{REQUEST_URI} =~ m#^/.well-known/acme-challenge/# |
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 const RAD2DEG = 180 / Math.PI; | |
export const DEG2RAD = Math.PI / 180; | |
// compute euclidean modulo of m % n | |
// https://en.wikipedia.org/wiki/Modulo_operation | |
export function euclideanModulo(n: number, m: number) { | |
return ((n % m) + m) % m; | |
} | |
export function clamp(value: number, min: number, max: number) { |
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 getUniqueArr = array => Array.from(new Set(array)); | |
const mergeArrs = (...arrs) => [].concat(...arrs); | |
const getUniqueMerge = (...arrs) => getUniqueArr(mergeArrs(...arrs)); | |
/** example with nested MenuItems | |
export interface MenuItem { | |
label: string; | |
icon?: string; | |
link?: Array<any>; | |
children?: Array<MenuItem>; |
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
/* example: @include truncate(24px, 30px, 3); */ | |
@mixin truncate($font-size, $line-height, $lines-to-show) { | |
display: block; // Fallback for non-webkit | |
display: -webkit-box; | |
max-width: 400px; | |
font-size: $font-size; | |
line-height: $line-height; | |
-webkit-line-clamp: $lines-to-show; | |
-webkit-box-orient: vertical; |
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
app.get("/robots.txt", function(req, res) { | |
res.type("text/plain"); | |
var rules = { | |
"User-agent": "*", | |
"Disallow": process.env.NODE_ENV === "production" ? "" : "/" | |
}; | |
var flattenedString = Object.keys(rules) | |
.map((key) => key + ": " + rules[key]) | |
.join("\n"); | |
res.send(flattenedString); |
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
.dl-horizontal { | |
$definitionWidth: 100px; | |
display: flex; | |
flex-wrap: wrap; | |
> dt { | |
width: $definitionWidth; | |
text-align: left; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
white-space: nowrap; |
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
#if UNITY_EDITOR | |
/** | |
This script should be located in an Editor folder | |
No need to try assigning it to a GameObject | |
It will run automatically when playing from the editor or during a build | |
see: https://docs.unity3d.com/ScriptReference/Build.IProcessSceneWithReport.OnProcessScene.html | |
*/ | |
using System; |
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 System; | |
using System.Collections; | |
using DG.Tweening; | |
using TMPro; | |
using UnityEngine; | |
using Wirelab.Pages; | |
public class ChatMessageItemRenderer : ItemRenderer<ChatMessageData> { | |
public BaseEvent onTimeout; |