Skip to content

Instantly share code, notes, and snippets.

View jiimaho's full-sized avatar
🎯
Focusing

Jim Aho jiimaho

🎯
Focusing
View GitHub Profile
@jiimaho
jiimaho / Startup.cs
Created December 15, 2019 22:19
Pseudocode: relation between UseDefaultFiles and UseStaticFiles
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app)
{
// ...
app.UseDefaultFiles();
app.UseStaticFiles();
// ...
}
@jiimaho
jiimaho / Startup.cs
Last active December 15, 2019 18:42
Pseudocode example: relation between UseDefaultFiles, UseSpaStaticFiles and UseSpa
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// ...
services.AddSpaStaticFiles(configuration =>
{
configuration.RootPath = "wwwroot";
});
// ...
}
app.UseSpa(spa =>
{
if (_environment.IsDevelopment())
{
// Make sure you have started the frontend with npm run dev on port 4000
spa.UseProxyToSpaDevelopmentServer("http://localhost:4000");
}
});
@jiimaho
jiimaho / Startup.cs
Last active December 15, 2019 17:37
services.AddSpaStaticFiles(
configuration =>
{
configuration.RootPath = "wwwroot"; // Or any other folder
});
Get-ChildItem C:\ -recurse -include "aaa.exe", "bbb.exe"
# Credit: https://stackoverflow.com/a/49110679/2874896
@jiimaho
jiimaho / remove-dir-and-obj-folders.ps1
Last active December 10, 2018 10:17
powershell remove dir and obj
function hardClean {
try {
Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) {
Write-Output "Deleting $_"
remove-item $_.FullName -Force -Recurse
}
}
catch {
Write-Output "error"
}
[user]
email = [email protected]
name = Chuck Norris
[core]
editor = 'C:\\Program Files\\Sublime Text 3\\subl.exe' -w
[alias]
st = status
c = commit -v
ca = commit --amend
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
git config --global core.editor "'C:\Program Files\Sublime Text 3\subl.exe' -w"
@jiimaho
jiimaho / add-git-log-alias.ps1
Created March 23, 2018 15:04
Pretty git log alias
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@jiimaho
jiimaho / git-to-file.ps1
Last active March 21, 2018 08:51
Write a short version of the lastest git commit message to a text file
git log -1 --pretty=format:"%h (%an) [%ad] : %s" --date=short > path\file.txt