This file contains 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.Security; | |
public static class ConsolePasswordInput | |
{ | |
public static SecureString? ReadPassword() | |
{ | |
var securePassword = new SecureString(); | |
while (true) | |
{ |
This file contains 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
// ==UserScript== | |
// @name F1 theatre mode | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Make F1TV videos theatre mode | |
// @author René Sackers | |
// @match https://f1tv.formula1.com/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== |
This file contains 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 class Policy | |
{ | |
public string Name { get; } | |
public Policy(string name) | |
{ | |
Name = name; | |
} | |
public static implicit operator string(Policy policy) => policy.Name; |
This file contains 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
[EventHandler(Events.Client.onClientResourceStart)] | |
private void onClientResourceStart(string resourceName) | |
{ | |
Debug.WriteLine($"{Events.Client.onClientResourceStart}"); | |
} | |
[EventHandler(Events.Client.onClientResourceStop)] | |
public void onClientResourceStop(string resourceName) | |
{ | |
Debug.WriteLine($"{Events.Client.onClientResourceStop}"); |
This file contains 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 class RegistrationBuilderExtensions | |
{ | |
public static IRegistrationBuilder<object, ScanningActivatorData, DynamicRegistrationStyle> NotAssignableTo<T>(this IRegistrationBuilder<object, ScanningActivatorData, DynamicRegistrationStyle> registration) | |
{ | |
return registration.NotAssignableTo(typeof(T)); | |
} | |
public static IRegistrationBuilder<TLimit, TScanningActivatorData, TRegistrationStyle> NotAssignableTo<TLimit, TScanningActivatorData, TRegistrationStyle>(this IRegistrationBuilder<TLimit, TScanningActivatorData, TRegistrationStyle> | |
registration, Type type) where TScanningActivatorData : ScanningActivatorData | |
{ |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<style> | |
html, body { |
This file contains 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 class AsyncHelper | |
{ | |
public static Task<T> RunAsync<T>(Func<T> callback) | |
{ | |
var taskCompletion = new TaskCompletionSource<T>(); | |
NAPI.Task.Run(() => | |
{ | |
try | |
{ |
This file contains 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
[Serializable] | |
public class TypedHubClientInterceptor : IInterceptor | |
{ | |
public delegate void MethodCalledHandler(MethodInfo methodInfo, params object[] args); | |
public void Intercept(IInvocation invocation) => | |
MethodCalled?.Invoke(invocation.Method, invocation.Arguments); | |
public event MethodCalledHandler MethodCalled; | |
} |
This file contains 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 class Program | |
{ | |
[STAThread] | |
public static void Main() | |
{ | |
AppDomain.CurrentDomain.AssemblyResolve += OnResolveAssembly; | |
App.Main(); | |
} | |
private static Assembly OnResolveAssembly(object sender, ResolveEventArgs args) |
This file contains 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
class EventDispatcher { | |
public static eventHandlers: { [key: string]: (args: any[]) => void } = {}; | |
constructor() { | |
API.onServerEventTrigger.connect(<any>this.onEventTrigger); | |
} | |
private onEventTrigger = (eventName: string, args: System.Array<any>) => { | |
var argsArray: any[] = []; |
NewerOlder