Skip to content

Instantly share code, notes, and snippets.

@alex-fomin
alex-fomin / HighDPIPlugin.ts
Last active December 9, 2021 07:56
High DPI plugin - add Retina canvas support to OCanvas
const highDPIPlugin = function () {
const scale = window.devicePixelRatio || 1;
if (scale === 1) {
return;
}
Object.defineProperty(this, "width", {
enumerable: true,
configurable: true,
set(value) {

Rider

⌘ ⇧ L Reformat code

@alex-fomin
alex-fomin / index.html
Last active March 21, 2018 14:49
Hotkeys, alfred workflows, etc
<html>
<head>
<style>
body {
color: white;
}
</style>
</head>
<body>
<table cellspacing="12"><caption>Alfred</caption>
@alex-fomin
alex-fomin / Program.cs
Created December 22, 2017 08:00
List vs LINQ
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
namespace ListVsEnumerable
{
[MemoryDiagnoser]
public class ListTest
{
@alex-fomin
alex-fomin / Program.cs
Created July 21, 2017 08:24
ToArray vs ToList vs ToImmutableArray vs ToImmutableList
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
namespace ConsoleApplication1
{
class Program