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
/* eslint-disable no-console */ | |
/*** | |
* This is a little server that emulates the protocol used by cloudflare's browser rendering API. In | |
* local development, you can run this server, and connect to it instead of cloudflare's (strictly | |
* limited) API. e.g. in your worker you might use a function like this: | |
* | |
* ```ts | |
* import { Browser, launch as launchPuppeteer } from '@cloudflare/puppeteer' | |
* function launchBrowser(env: Environment) { | |
* if (env.LOCAL_BROWSER_ORIGIN) { |
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
/** | |
* Mock GPU information with real values. Check using: https://bot.sannysoft.com/ | |
*/ | |
WebGLRenderingContext.prototype.getParameter = function(origFn) { | |
const paramMap = {}; | |
paramMap[0x9245] = "Google Inc. (NVIDIA Corporation)"; // UNMASKED_VENDOR_WEBGL | |
paramMap[0x9246] = "ANGLE (NVIDIA Corporation, Quadro P400/PCIe/SSE2, OpenGL 4.5.0)"; // UNMASKED_RENDERER_WEBGL | |
paramMap[0x1F00] = "WebKit"; // VENDOR | |
paramMap[0x1F01] = "WebKit WebGL"; // RENDERER | |
paramMap[0x1F02] = "WebGL 1.0 (OpenGL ES 2.0 Chromium)"; // VERSION |
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.Diagnostics; | |
using System.Text; | |
using System.Threading.Tasks; | |
public static class ProcessAsyncHelper | |
{ | |
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout) | |
{ | |
var result = new ProcessResult(); |
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 AutoMapper; | |
namespace Application.Common.Mappings | |
{ | |
public interface IMapFrom<T> | |
{ | |
void Mapping(Profile profile) => profile.CreateMap(typeof(T), GetType()); | |
} | |
} |
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
try | |
{ | |
throw new Exception("test"); | |
} | |
catch (Exception ex) | |
{ | |
Assert.Equal("test", ex.Message); | |
} |
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 SnowflakeIdGenerator | |
{ | |
public const byte DefaultMachineIdBits = 6; | |
public const byte DefaultSequenceBits = 12; | |
private readonly long _machineId = 0; | |
private readonly byte _machineIdBits = 0; | |
private readonly byte _sequenceBits = 0; | |
private readonly long _maxSequence = 0; | |
private readonly Stopwatch _stopwatch = Stopwatch.StartNew(); | |
private readonly object _lockObject = new object(); |
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.Collections.Generic; | |
using System.Reflection; | |
using System.ArrayExtensions; | |
namespace System | |
{ | |
public static class ObjectExtensions | |
{ | |
private static readonly MethodInfo CloneMethod = typeof(Object).GetMethod("MemberwiseClone", BindingFlags.NonPublic | BindingFlags.Instance); |
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
h1 { | |
color: #666; | |
} |
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
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video | |
{ | |
margin: 0; | |
padding: 0; | |
border: 0; | |
font: inherit; | |
font-size: 100%; | |
vertical-align: baseline; | |
} |
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
.bootstrap-wrapper {font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%} | |
/*.bootstrap-wrapper body{margin:0}*/ | |
.bootstrap-wrapper article, .bootstrap-wrapper aside, .bootstrap-wrapper details, .bootstrap-wrapper figcaption, .bootstrap-wrapper figure, .bootstrap-wrapper footer, .bootstrap-wrapper header, .bootstrap-wrapper hgroup, .bootstrap-wrapper main, .bootstrap-wrapper menu, .bootstrap-wrapper nav, .bootstrap-wrapper section, .bootstrap-wrapper summary{display:block} | |
.bootstrap-wrapper audio, .bootstrap-wrapper canvas, .bootstrap-wrapper progress, .bootstrap-wrapper video{display:inline-block;vertical-align:baseline} | |
.bootstrap-wrapper audio:not([controls]){display:none;height:0} | |
.bootstrap-wrapper [hidden], .bootstrap-wrapper template{display:none} | |
.bootstrap-wrapper a{background-color:transparent} | |
.bootstrap-wrapper a:active, .bootstrap-wrapper a:hover{outline:0} | |
.bootstrap-wrapper abbr[title]{border-bottom:1px dotted} | |
.bootstrap-wrapper b, .bootstrap-wrapper strong{font-weigh |
NewerOlder