Skip to content

Instantly share code, notes, and snippets.

View ashleydavis's full-sized avatar

Ashley Davis ashleydavis

View GitHub Profile
@ashleydavis
ashleydavis / typescript-compiler.ts
Created April 30, 2020 08:36
An example of using the TypeScript compiler from TypeScript
import * as path from "path";
import { IDiagnostic } from "./language-code-generator";
import { readJsonFile } from "../common/file";
//
// Result of compiling TypeScript code.
//
export interface ICompilationResult {
code?: string;
diagnostics: IDiagnostic[];
@ashleydavis
ashleydavis / event-source.ts
Created January 15, 2019 06:12
C# style events in JavaScript
// https://stackoverflow.com/a/15964759/25868
export type BasicEventHandler = () => void;
export type SenderEventHandler<SenderT> = (sender: SenderT) => void;
//
// Simulate C# style events in JS.
//
export interface IEventSource<HandlerType extends Function> {
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
/// <summary>
/// A simple free camera to be added to a Unity game object.
///
/// Keys: