Skip to content

Instantly share code, notes, and snippets.

View grandsilence's full-sized avatar
💻
Freelancer

Grand Silence grandsilence

💻
Freelancer
View GitHub Profile
@grandsilence
grandsilence / MonitorsInfo.cs
Last active November 14, 2018 18:02
C# Получение модели монитора
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;
namespace ConsoleApp1
{
public static class MonitorsInfo
{
@grandsilence
grandsilence / JS - Image Aspect Ratio Fit.js
Last active February 5, 2019 23:44
Conserve aspect ratio image
/**
* Conserve aspect ratio of the orignal region. Useful when shrinking/enlarging
* images to fit into a certain area.
*
* @param {Number} srcWidth Source area width
* @param {Number} srcHeight Source area height
* @param {Number} maxWidth Fittable area maximum available width
* @param {Number} maxHeight Fittable area maximum available height
* @return {Object} { width, heigth }
*