Skip to content

Instantly share code, notes, and snippets.

View evan-boissonnot's full-sized avatar
🏠
Working from home

Evan BOISSONNOT evan-boissonnot

🏠
Working from home
View GitHub Profile
@evan-boissonnot
evan-boissonnot / test-mediatr-and-cqrs-handler
Last active December 21, 2021 15:55
Mediatr and service collection to test handler within controller
public async Task ShouldReturnListOfSelfies()
{
// ARRANGE
var expectedList = new List<Selfie>()
{
new Selfie() { Wookie = new Wookie() },
new Selfie() { Wookie = new Wookie() }
};
var repositoryMock = new Mock<ISelfieRepository>();
@evan-boissonnot
evan-boissonnot / Slot.cs
Created June 25, 2021 22:24
Godot - Drag and drop example in GDScript and C#
/**
* Handle input events on the current slot.
*
* @param InputEvent @event The input event to handle
*
* @return void
*/
public override void _GuiInput(InputEvent @event)
{
// If right click, then equip item
@evan-boissonnot
evan-boissonnot / GenerateToken.cs
Created February 19, 2021 16:19
Generate token JWT C#
private string GenerateJwtToken(IdentityUser user)
{
// Now its ime to define the jwt token which will be responsible of creating our tokens
var jwtTokenHandler = new JwtSecurityTokenHandler();
// We get our secret from the appsettings
var key = Encoding.ASCII.GetBytes(_jwtConfig.Secret);
// we define our token descriptor
// We need to utilise claims which are properties in our token which gives information about the token
@evan-boissonnot
evan-boissonnot / index.html
Created February 19, 2021 13:20
fetch to our web api dotnet core
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Test api</h1>
@evan-boissonnot
evan-boissonnot / IIS_Verbs.config
Created February 19, 2021 10:37 — forked from Jalalhejazi/IIS_Verbs.config
CORS: Web.config to enable CORS
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Methods" value="GET,PUT,POST,DELETE,OPTIONS"/>
<add name="Access-Control-Allow-Headers" value="Content-Type"/>
</customHeaders>
</httpProtocol>
@evan-boissonnot
evan-boissonnot / package.json
Created October 22, 2020 23:04
Package.json for node with typescript
{
"name": "decouverte-typescript",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"tsc": "tsc",
"ts-node-dev": "ts-node-dev",
"build": "tsc",
"dev": "ts-node-dev src/main.ts",
@evan-boissonnot
evan-boissonnot / tsconfig.json
Created October 22, 2020 23:00
tsconfig.json for node.js with typescript
{
"compilerOptions": {
"target": "ES2017",
"module": "ESNext",
"outDir": "dist"
},
"files": [
"./node_modules/@types/node/index.d.ts"
],
"include": [
@evan-boissonnot
evan-boissonnot / gist:311eaaf4db7af88f63c60fb3a68f38f4
Created July 29, 2020 16:03 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@evan-boissonnot
evan-boissonnot / commit-config.sh
Created July 28, 2020 08:30 — forked from tqheel/commit-config.sh
Prevent ASP.Net Web.Config From Being Committed By Git
#Run this to reverse ignoring of changes to web.config so it gets committed.
git update-index --no-assume-unchanged path_to_file/web.config
@evan-boissonnot
evan-boissonnot / commit-config.sh
Created July 28, 2020 08:30 — forked from tqheel/commit-config.sh
Prevent ASP.Net Web.Config From Being Committed By Git
#Run this to reverse ignoring of changes to web.config so it gets committed.
git update-index --no-assume-unchanged path_to_file/web.config