Skip to content

Instantly share code, notes, and snippets.

View samonzeweb's full-sized avatar

Samuel GAY samonzeweb

View GitHub Profile
@samonzeweb
samonzeweb / asp.net-core.json
Created March 27, 2018 13:55
VS Code snippets for APS.NET Core
{
"ASP.NET Core MVC Controller": {
"prefix": "controller",
"description": "A minimal ASP.NET Core MVC controller.",
"body": [
"using System;",
"using System.Collections.Generic;",
"using System.Linq;",
"using System.Threading.Tasks;",
"using Microsoft.AspNetCore.Mvc;",
@samonzeweb
samonzeweb / godb_decimal.go
Created April 19, 2018 12:09
Use of github.com/shopspring/decimal with SQL Server (through godb)
package main
import (
"fmt"
"github.com/samonzeweb/godb"
"github.com/samonzeweb/godb/adapters/mssql"
"github.com/samonzeweb/godb/dbreflect"
"github.com/shopspring/decimal"
)
@samonzeweb
samonzeweb / dependency.rb
Last active December 6, 2018 14:56
Extract and display nuget packages dependencies
#! /usr/bin/env ruby
# Parse all NuGet packages under the package directory and print
# all packages names followeb by its dependencies. The format
# is not pretty, but useful combined with 'grep'.
require 'zip' # rubyzip
require 'rexml/document'
Dir.glob("packages/**/*.nupkg").each do |nupkg|
@samonzeweb
samonzeweb / fix.md
Last active January 1, 2020 11:07
Node does not detect file changes (dev server)

Modification temporaire

sudo -s

cat /proc/sys/fs/inotify/max_user_watches
8192

echo 524288 > /proc/sys/fs/inotify/max_user_watches
@samonzeweb
samonzeweb / Program.cs
Created May 17, 2021 12:09
ASP.NET Core : open browser on start, and stop server from browser.
// This exemple shows :
// * how to start an app with a free local port
// * how to find urls used and open a brower
// * how to stop the server
//
// Of course it's not production ready, it's a simple howto/reminder.
//
// Some part are come from :
// https://andrewlock.net/how-to-automatically-choose-a-free-port-in-asp-net-core/