Skip to content

Instantly share code, notes, and snippets.

View bleroy's full-sized avatar

Bertrand Le Roy bleroy

View GitHub Profile
using ImageSharp;
const int size = 150;
const int quality = 75;
Configuration.Default.AddImageFormat(new JpegFormat());
using (var input = File.OpenRead(inputPath))
{
using (var output = File.OpenWrite(outputPath))
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="ImageSharp Nightly" value="https://www.myget.org/F/imagesharp/api/v3/index.json" />
</packageSources>
</configuration>
using System.Drawing;
const int size = 150;
const int quality = 75;
using (var image = new Bitmap(System.Drawing.Image.FromFile(inputPath)))
{
int width, height;
if (image.Width > image.Height)
{
{
"PwdLess": {
"Totp": {
"Expiry": 15,
"Length": 10
},
"Jwt": {
"SecretKey": "9e38e3-REPLACE-WITH-YOUR-SECRET-5181742b",
"Issuer": "YOUR_ISS_NAME",
"Expiry": "",
@bleroy
bleroy / WeekIn.NET.20170124.md
Last active January 24, 2017 12:31
Tips for the Week in .NET
Window "MainWindow" {
Width: 200
Height: 100
TextBlock {
Text: "Hello, World!"
}
}
@bleroy
bleroy / WeekIn.NET.20170117.md
Last active January 17, 2017 09:34
Tips for the Week in .NET
var person = new Person {
Id = 12345, Name = "Fred",
Address = new Address {
Line1 = "Flat 1",
Line2 = "The Meadows"
}
};
using (var file = File.Create("person.bin")) {
Serializer.Serialize(file, person);
[ProtoContract]
class Person {
[ProtoMember(1)]
public int Id {get;set;}
[ProtoMember(2)]
public string Name {get;set;}
[ProtoMember(3)]
public Address Address {get;set;}
}
@bleroy
bleroy / WeekIn.NET.20170110.md
Last active January 10, 2017 14:47
Tips for the Week in .NET