This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based off the longer gist at https://gist.github.com/mwhite/6887990 | |
[alias] | |
# one-line log | |
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
# staging | |
a = add | |
ac = !git add . && git commit -am | |
ap = add -p | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private OAuthOptions GitHubOptions => | |
new OAuthOptions | |
{ | |
AuthenticationScheme = "GitHub", | |
DisplayName = "GitHub", | |
ClientId = Configuration["GitHub:ClientId"], | |
ClientSecret = Configuration["GitHub:ClientSecret"], | |
CallbackPath = new PathString("/signin-github"), | |
AuthorizationEndpoint = "https://github.com/login/oauth/authorize", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void AddClaims(OAuthCreatingTicketContext context, JObject user) | |
{ | |
var identifier = user.Value<string>("id"); | |
if (!string.IsNullOrEmpty(identifier)) | |
{ | |
context.Identity.AddClaim(new Claim( | |
ClaimTypes.NameIdentifier, identifier, | |
ClaimValueTypes.String, context.Options.ClaimsIssuer)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static async Task CreatingGitHubAuthTicket(OAuthCreatingTicketContext context) | |
{ | |
// Get the GitHub user | |
var request = new HttpRequestMessage(HttpMethod.Get, context.Options.UserInformationEndpoint); | |
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", context.AccessToken); | |
request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); | |
var response = await context.Backchannel.SendAsync(request, context.HttpContext.RequestAborted); | |
response.EnsureSuccessStatusCode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# launch browser tabs | |
Start-Process "https://employer.harvestapp.com/time" | |
Start-Process "https://github.com/Client_Folder/" | |
Start-Process "https://app.box.com/files/0/f/0" | |
# launch VS solutions | |
Start-Process "C:\james\code\project name\src\solution.sln " | |
# start development apps | |
& C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
$.stringDictionary = function () { | |
this.data = {}; | |
// adds a unique value to the array stored in 'key' | |
this.add = function (key, value) { | |
var editors = this.data[key]; | |
if (editors) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void PutDocument(string postUrl, string document) | |
{ | |
byte[] data = new ASCIIEncoding().GetBytes(document); | |
var request = (HttpWebRequest)WebRequest.Create(postUrl); | |
request.Credentials = new NetworkCredential(_username, _password); | |
request.Method = "PUT"; | |
request.ContentType = "text/json"; | |
request.ContentLength = data.Length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<string> times = new List<string>(); | |
Enumerable.Range(0, 24).ToList() | |
.ForEach(hour => Enumerable.Range(0, 2).ToList() | |
.Select(x => string.Format("{0}:{1:00}", hour, x * 30)) | |
.ToList() | |
.ForEach(timeslot=>times.Add(timeslot))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IEnumerable<int> hours = | |
Enumerable.Range(0, 24); | |
IEnumerable<int> minutes = | |
Enumerable.Range(0, 2).Select(x => x * 30); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Icons | |
{ | |
public const string Glass = "icon-glass"; | |
public const string Music = "icon-music"; | |
public const string Search = "icon-search"; | |
public const string Envelope = "icon-envelope"; | |
public const string Heart = "icon-heart"; | |
public const string Star = "icon-star"; | |
public const string StarEmpty = "icon-star-empty"; | |
public const string User = "icon-user"; |
NewerOlder