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; | |
using System.Threading; | |
namespace System | |
{ | |
public class LazyType<T> | |
{ | |
private static readonly Func<T> DefaultValueFactory = () => default(T); | |
private readonly object _lock; |
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; | |
using System.Runtime.InteropServices; | |
namespace System.Input | |
{ | |
public class KeyboardState | |
{ | |
[DllImport("user32.dll")] | |
private static extern int GetKeyboardState(byte[] buffer); |
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; | |
using System.ComponentModel; | |
using System.Runtime.Serialization; | |
namespace System.Runtime.InteropServices | |
{ | |
public static class DynamicImport | |
{ | |
[DllImport("kernel32.dll", EntryPoint = "GetProcAddress", SetLastError = true, CharSet = CharSet.Ansi)] | |
private static extern IntPtr GetProcAddress(IntPtr hModule, string procname); |
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; | |
using System.Runtime.InteropServices; | |
namespace System.Input | |
{ | |
public static class AsyncKeyState | |
{ | |
[DllImport("user32.dll")] | |
private static extern short GetAsyncKeyState(int key); | |
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; | |
namespace System | |
{ | |
public static class IntPtrExtensions | |
{ | |
private static readonly bool _x86 = IntPtr.Size == 4; | |
public static ulong GetValue(this IntPtr ptr) | |
{ |
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; | |
using System.Threading; | |
namespace System | |
{ | |
/// <summary> | |
/// Represents a static and thread safe pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness. | |
/// </summary> | |
public static class StaticRandom | |
{ |
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; | |
using System.Text; | |
using System.Security.Cryptography; | |
using System.Runtime.InteropServices; | |
namespace System.Security.Cryptography.Provider | |
{ | |
/// <summary> | |
/// Provides static methods to use hash algorithms in a generic way. | |
/// </summary> |
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; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using System.Windows.Controls; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Media3D; | |
namespace System.Windows.Extensions | |
{ |
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
function DiscordWidgetData() { | |
this.load = async function (guildId) { | |
return new Promise(function (resolve, reject) { | |
fetch("https://discordapp.com/api/v6/guilds/" + guildId + "/widget.json", { | |
method: "GET", | |
mode: "cors", | |
cache: "reload", | |
redirect: "follow" | |
}).then(response => { | |
if (!response.ok) { |
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
<?php | |
namespace MichelPi\Utils; | |
use DateTime; | |
class DateTimeFormat | |
{ | |
private static $_jsonFormatString = 'Y-m-d\\TH:i:s.v\\Z'; | |
private static $_mysqlFormatString = 'Y-m-d H:i:s'; |
OlderNewer