Skip to content

Instantly share code, notes, and snippets.

View seangwright's full-sized avatar
🐻
Still learning...

Sean G. Wright seangwright

🐻
Still learning...
View GitHub Profile
@seangwright
seangwright / .gitconfig
Last active January 30, 2016 06:15
Helpful windows .gitconfig
[user]
name = Your Name
email = email@site.com
[core]
autocrlf = true
excludesfile = c:/path/to/your/repos/global.gitignore
# The default editor used when git needs one for you to interact with (ie 'git commit' without a message)
editor = 'C:/path/to/editor/of/choice/editor.exe' -options -for -editor
[gui]
@seangwright
seangwright / directive.js
Created September 29, 2015 16:58
ES2015 Angular directive definition with ngAnnotate annotation & ES2015 module format
function appCompareTo(serviceOne, serviceTwo) {
'ngInject'; // Note position of 'ngInject' annotation
return {
require: "ngModel",
scope: {
otherModelValue: "=appCompareTo"
},
link: link
};
@seangwright
seangwright / dashboard.js
Last active January 13, 2016 19:48
Kentico REST API w/ Forms Auth + AngularJS
(function (angular) {
"use strict";
let yourDomain = 'enter-your-domain-here';
let yourUsername = 'enter-your-username-here';
let yourPassword = 'enter-your-password-here';
let app = angular.module('dashboard', ['ngTouch', 'ui.grid', 'ui.grid.edit', 'ui.grid.rowEdit', 'ui.grid.cellNav']);
app.controller('DashboardController', DashboardController)
@seangwright
seangwright / .bashrc
Last active February 26, 2016 15:31
Sample .bashrc
# Filesystem aliases
alias ls='ls -F --color=auto --show-control-chars'
alias ll='ls -alh'
alias size='du -sh *'
# Git aliases
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
@seangwright
seangwright / .bash_profile
Created January 30, 2016 06:33
Sample .bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
# Sets the Prompt string to look something like user@PC /c/dev/projects/programming-authentication (master)
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title
PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
PS1="$PS1"'\u@\h ' # user@host<space>
PS1="$PS1"'\[\033[35m\]' # change to purple
@seangwright
seangwright / BasePrefixRouteProvider.cs
Created April 23, 2016 18:10
BasePrefixRouteProvider.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http.Controllers;
using System.Web.Http.Routing;
namespace WiredViews.WIR03.Web.Api.Configuration
{
/// <summary>
@seangwright
seangwright / ErrorResult.cs
Created April 23, 2016 18:12
ErrorResult.cs
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using System.Threading;
@seangwright
seangwright / GlobalExceptionHandler.cs
Created April 23, 2016 18:14
GlobalExceptionHandler.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Net;
using System.Web.Http.ExceptionHandling;
using WiredViews.WIR03.Web.Api.Results;
namespace WiredViews.WIR03.Web.Api.Exceptions
@seangwright
seangwright / WebApiConfig.cs
Created April 24, 2016 02:47
WebApiConfig.cs
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Formatting;
using System.Web.Http;
using WiredViews.WIR03.Web.Api.Exceptions;
namespace WiredViews.WIR03.Web.Api.Configuration
@seangwright
seangwright / SwashbuckleConfiguration.cs
Created April 24, 2016 02:47
SwashbuckleConfiguration.cs
using Swashbuckle.Application;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
namespace WiredViews.WIR03.Web.Api.Configuration
{
/// <summary>