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 React, { useMemo, useRef, useState } from "react"; | |
| import { Star } from "lucide-react"; | |
| export type InteractiveStarsProps = { | |
| /** Current rating (0–max). Controlled. */ | |
| value: number; | |
| /** Called when the user selects a rating. */ | |
| onChange: (val: number) => void | Promise<void>; | |
| /** Number of stars to render (default 5). */ | |
| 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
| import {EventEmitter, Injectable, OnDestroy} from "@angular/core"; | |
| /** | |
| * Interface to ensure broadcast message uniformity. | |
| */ | |
| export interface IBroadcastMessage { | |
| source: string; | |
| target: string; | |
| action: string; | |
| payload: any; |
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 { Directive, ElementRef, HostListener, Input } from "@angular/core"; | |
| /** | |
| * Ensures the associated element only allows digits to be entered. | |
| * Allows for editing and in-element navigation. | |
| * | |
| * Usage: digitOnly allowSpaces="false" | |
| */ | |
| @Directive({ | |
| selector: "[digitOnly]" |
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 log4net; | |
| using Microsoft.Exchange.WebServices.Data; | |
| using System; | |
| using System.Configuration; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Net; | |
| using System.ServiceProcess; | |
| using System.Timers; |
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
| /* | |
| * Throws up a notification to tell the end-user a | |
| * server call (ajax) is happening and prevents them | |
| * from clicking elsewhere on the screen while it's | |
| * working. | |
| * USAGE: $.ajaxWorking(); | |
| */ | |
| ; (function ($) { | |
| $.extend({ |
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
| function validateVin(vin) { | |
| if (vin == "11111111111111111") { return false; } | |
| if (!vin.match("^([0-9a-hj-npr-zA-HJ-NPR-Z]{10,17})+$")) { return false;} | |
| var letters = [{ k: "A", v: 1 }, { k: "B", v: 2 }, { k: "C", v: 3 }, | |
| { k: "D", v: 4 }, { k: "E", v: 5 }, { k: "F", v: 6 }, { k: "G", v: 7 }, | |
| { k: "H", v: 8 }, { k: "J", v: 1 }, { k: "K", v: 2 }, { k: "L", v: 3 }, | |
| { k: "M", v: 4 }, { k: "N", v: 5 }, { k: "P", v: 7 }, { k: "R", v: 9 }, | |
| { k: "S", v: 2 }, { k: "T", v: 3 }, { k: "U", v: 4 }, { k: "V", v: 5 }, | |
| { k: "W", v: 6 }, { k: "X", v: 7 }, { k: "Y", v: 8 }, { k: "Z", v: 9 }]; | |
| var weights = [8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2]; |
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
| /** | |
| * @name InfoBox | |
| * @version 1.1.11 [January 9, 2012] | |
| * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google) | |
| * @copyright Copyright 2010 Gary Little [gary at luxcentral.com] | |
| * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class. | |
| * <p> | |
| * An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several | |
| * additional properties for advanced styling. An InfoBox can also be used as a map label. | |
| * <p> |
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
| ALTER TABLE MyTable WITH CHECK ADD CONSTRAINT [CK_MyTable_MyId_NotEmpty] CHECK (MyId<>CAST(0x0 AS UNIQUEIDENTIFIER)) | |
| GO |
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
| public static string ToRelativeDateString(this DateTime date) | |
| { | |
| return DateTimeExtensions.GetRelativeDateValue(date, DateTime.Now); | |
| } | |
| public static string ToRelativeDateStringUtc(this DateTime date) | |
| { | |
| return DateTimeExtensions.GetRelativeDateValue(date, DateTime.UtcNow); | |
| } | |
| private static string GetRelativeDateValue(DateTime date, DateTime comparedTo) | |
| { |