Skip to content

Instantly share code, notes, and snippets.

View bertt's full-sized avatar

Bert Temme bertt

View GitHub Profile
@HimDek
HimDek / Hyper-V in Windows 10 and Windows 11 Home Edition.md
Last active May 16, 2024 06:48
Hyper-V is supported in Pro, Enterprise and Education Edition of Windows 10 and Windows 11. This guide will show you how to enable Hyper-V in Home Editions of Windows 10 and Windows 11.

Hyper-V in Windows 10 and Windows 11 Home Edition

Hyper-V in Windows 10 and Windows 11 allows running Virtual Machine. It is supported only in Pro, Enterprise and Education Edition of Windows 10 and Windows 11 by default. But this guide will show you how to enable it in Home Editions of Windows 10 and Windows 11.

Check if virtualization is enabled:

  • Search for Command Prompt in Windows Start Menu and open it.
  • Type systeminfo and press Enter. Wait for the process to finish
  • Once the results appear, search for the Hyper-V Requirements section which is usually the last one. 11
    • If it says A hypervisor has been detected. Features required for Hyper-V will not be displayed. that means Hyper-V is already enabled and there is no reason following this guide anymore.
  • Otherwise, check for Virtualization Enabled in Firmware:.
@richlander
richlander / modernizing-csharp9.md
Last active April 26, 2024 17:14
Modernizing a codebase for C# 9

Modernizing a codebase for C# 9

There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.

Use the property pattern to replace IsNullorEmpty

Consider adopting the new property pattern, wherever you use IsNullOrEmpty.

string? hello = "hello world";
@IanColdwater
IanColdwater / twittermute.txt
Last active April 22, 2024 17:26
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@govert
govert / GpsUtils.cs
Last active March 25, 2024 08:43
Convert WGS-84 geodetic locations (GPS readings) to Cartesian coordinates in a local tangent plane (Geodetic to ECEF to ENU)
using System;
using System.Diagnostics;
using static System.Math;
// Some helpers for converting GPS readings from the WGS84 geodetic system to a local North-East-Up cartesian axis.
// The implementation here is according to the paper:
// "Conversion of Geodetic coordinates to the Local Tangent Plane" Version 2.01.
// "The basic reference for this paper is J.Farrell & M.Barth 'The Global Positioning System & Inertial Navigation'"
// Also helpful is Wikipedia: http://en.wikipedia.org/wiki/Geodetic_datum
@shinyzhu
shinyzhu / GooglePoints.cs
Last active February 7, 2024 12:13
Encode/Decode Polyline Algorithm Format in C#
/// <summary>
/// See https://developers.google.com/maps/documentation/utilities/polylinealgorithm
/// </summary>
public static class GooglePoints
{
/// <summary>
/// Decode google style polyline coordinates.
/// </summary>
/// <param name="encodedPoints"></param>
/// <returns></returns>
@jhmt
jhmt / Vincenty.cs
Created June 14, 2020 06:42
C# implementation of Vincenty's formula direct problem
using System;
namespace Vincenty
{
public class Vincenty
{
private double RadiusLong = 6378137.0;
private double Flatts = 1 / 298.257222101;
private double RadiusShort => RadiusLong * (1 - Flatts);
@richlander
richlander / Dockerfile
Created June 14, 2018 00:57
ASP.NET Web Forms Multi-stage build Dockerfile
FROM microsoft/dotnet-framework:4.7.2-sdk AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.sln .
COPY aspnetapp/*.csproj ./aspnetapp/
COPY aspnetapp/*.config ./aspnetapp/
RUN nuget restore
# copy everything else and build app
@norwegianblueparrot
norwegianblueparrot / bourtange.R
Last active November 25, 2023 03:40
A script to produce a 3D render of Fort Bourtange from LiDAR data
## ----setup,include=FALSE,message=FALSE,warning=FALSE-----------------------------------------------------------------------------------------------------------------------------------------------------
library("here") # 1.0.1
library("sf") # 1.0-14
library("rgl") # 1.2.1
library("geoviz") # 0.2.2
library("raster") # 3.6-26
library("rayshader") # 0.35.7
library("osmdata") # 0.2.5
library("tidyverse") # 2.0.0
@mattdesl
mattdesl / about.md
Last active July 17, 2023 09:20
optimizing & de-duplicating geometry in GLTF files

optimize GLTF file

This optimizes a GLTF file that was exported by blender (or similar) by de-duplicating buffer views (i.e. chunks of bytes) that are equal and removing redundant accessors.

For example, 100 cubes of different scales/materials/rotations/etc should all end up using a single BufferGeometry in ThreeJS, which isn't the case with current GLTF exporters in Blender and parsers for ThreeJS.

In scenes with a lot of instancing, it can dramatically reduce total file size as well as render performance. In one test scene:

Before: 4.8MB file size, 832 THREE.Geometry instances across 832 THREE.Mesh objects
After: 661KB file size, 13 THREE.Geometry instances across 832 THREE.Mesh objects

@bdon
bdon / example.html
Created October 13, 2022 03:43
example use of pmtiles 2.0.0 with maplibre
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Display a map</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<script src="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.js"></script>
<link href="https://unpkg.com/maplibre-gl@2.4.0/dist/maplibre-gl.css" rel="stylesheet" />
<script src="https://unpkg.com/pmtiles@2.0.0/dist/index.js"></script>
<style>