Skip to content

Instantly share code, notes, and snippets.

View christo8989's full-sized avatar

Christopher Jeffery christo8989

View GitHub Profile
@christo8989
christo8989 / .gitconfig
Created July 1, 2020 00:10 — forked from ddddavidmartin/.gitconfig
Git checkout alias that accepts regular expressions
[alias]
co = !"find_and_checkout_branch(){\
for last; do true; done ; \
pattern='^/.*/$' ;\
if [[ $# -eq 1 && $last =~ $pattern ]] ;\
then \
branch_pattern=`echo $last | sed -e 's/^\\///' -e 's/\\/$//'` ;\
branch=`git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | grep -E -i $branch_pattern | head -n1` ;\
if [[ $branch ]] ; then \
git checkout $branch ;\
@christo8989
christo8989 / nginx.conf
Last active February 11, 2018 17:39 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048

Owin Authentication with Web API 2

Using Microsoft.Owin.Security along with .NET Web API 2 for authentication on Single Page Applications.

My example is split up into 2 different projects, API which is WebAPI2 project and MyProj which is a basic MVC that contains primarily only JavaScript/CSS/etc and the startup classes.

Installed NuGet Packages

Microsoft.AspNet.Identity.Owin

Microsoft.Owin.Host.SystemWeb