Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View salaros's full-sized avatar
🎉
Making magic happen

Yaroslav Zhmayev salaros

🎉
Making magic happen
View GitHub Profile
@salaros
salaros / BytesHelper.cs
Last active June 9, 2023 14:11
Comparing two arrays of bytes in C#
public static class BytesHelper
{
// Copyright (c) 2008-2013 Hafthor Stefansson
// Distributed under the MIT/X11 software license
// Ref: http://www.opensource.org/licenses/mit-license.php.
public static unsafe bool Equals(byte[] a1, byte[] a2)
{
if (a1 == a2)
return true;
@leeoniya
leeoniya / letsencrypt_2017.md
Created December 31, 2017 02:54 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@sebastienros
sebastienros / PortableObject-NETCore.md
Last active September 27, 2023 01:01
Configuring Portable Object localization in ASP.NET Core

Configuring Portable Object localization in ASP.NET Core

The package which is used in this article is avaible on MyGet on this url: https://www.myget.org/F/orchardcore-preview/api/v3/index.json

This article walks you through the steps for using Portable Object files (PO files) inside your ASP.NET Core application.

What is a PO file

PO files are files that contain the translated strings for a given language. They reveal very useful as contrary to standard resx files, PO files support pluralization and are distributed as text files.

@Brainiarc7
Brainiarc7 / skylake-tuning-linux.md
Last active March 30, 2024 16:01
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

@kashimAstro
kashimAstro / README.md
Last active May 5, 2021 17:47
H3 / Mali GPU driver and openframeworks armv7 ES / ES2

#A small guide to compile openFrameworks armv7 with driver OpenGL ES / ES2 sunxi for H3 / Mali GPU on ARMBIAN OS, compatible with orangepi and bananapi.

tested on: orangepi one banana pi M2

dependencies:

apt-get install libx11-dev libxext-dev xutils-dev libdrm-dev \ 
           x11proto-xf86dri-dev libxfixes-dev x11proto-dri2-dev xserver-xorg-dev \
 build-essential automake pkg-config libtool ca-certificates git cmake subversion
@tverboon
tverboon / opencover.build
Created July 18, 2016 06:05
Use OpenCover with .Net Core in MSBuild
<PropertyGroup>
<NuGetPackageDir>$(UserProfile)\.nuget\packages\</NuGetPackageDir>
<OpenCover>$(NuGetPackageDir)OpenCover\4.6.519\tools\OpenCover.Console.exe</OpenCover>
<XUnitConsolePath>$(NuGetPackageDir)xunit.runner.console\2.2.0-beta2-build3300\tools\xunit.console.exe</XUnitConsolePath>
<CoverageConverter>$(NuGetPackageDir)OpenCoverToCoberturaConverter\0.2.4\tools\OpenCoverToCoberturaConverter.exe</CoverageConverter>
</PropertyGroup>
<Target Name="Test">
<MakeDir Directories="$(TestResultsPath)" Condition = "!Exists('$(TestResultsPath)')" />
<ItemGroup>
@jayrulez
jayrulez / country-code-to-currency-code-mapping.csv
Created July 14, 2016 02:46 — forked from HarishChaudhari/country-code-to-currency-code-mapping.csv
Country, Country Code, Currency code mapping in CSV format Taken from https://gist.github.com/304261 Contains 249 countries.
Country CountryCode Currency Code
New Zealand NZ New Zealand Dollars NZD
Cook Islands CK New Zealand Dollars NZD
Niue NU New Zealand Dollars NZD
Pitcairn PN New Zealand Dollars NZD
Tokelau TK New Zealand Dollars NZD
Australian AU Australian Dollars AUD
Christmas Island CX Australian Dollars AUD
Cocos (Keeling) Islands CC Australian Dollars AUD
Heard and Mc Donald Islands HM Australian Dollars AUD
@teocomi
teocomi / revit-addin-locations.txt
Last active February 23, 2024 18:17
Revit Addin folder location
Autodesk Revit addins are generally loaded from the following locations.
User Addins:
%appdata%\Autodesk\Revit\Addins\
%appdata%\Autodesk\ApplicationPlugins\
Machine Addins (for all users of the machine):
C:\ProgramData\Autodesk\Revit\Addins\
Addins packaged for the Autodesk Exchange store:
@phuphighter
phuphighter / mediaqueries.css
Created June 29, 2016 14:10
Semantic UI friendly media queries
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
[class*="tablet only"]:not(.mobile),
[class*="computer only"]:not(.mobile),
[class*="large screen only"]:not(.mobile),
[class*="widescreen only"]:not(.mobile),
[class*="or lower hidden"] {
display: none !important;
}
@daredude
daredude / docker-clear.bat
Created June 5, 2016 10:53
delete all docker container and images on windows
@echo off
FOR /f "tokens=*" %%i IN ('docker ps -aq') DO docker rm %%i
FOR /f "tokens=*" %%i IN ('docker images --format "{{.ID}}"') DO docker rmi %%i