Skip to content

Instantly share code, notes, and snippets.

View jptoto's full-sized avatar
😃

JP Toto jptoto

😃
View GitHub Profile

Git Cheat Sheet

Commands

Getting Started

git init

or

@jongalloway
jongalloway / recursive-nuget-package-restore.ps1
Last active May 12, 2016 18:16
Recursive NuGet Package Restore
get-childitem . -include *.sln -recurse | foreach ($_) { nuget restore $_.FullName -verbosity detailed}
get-childitem . -include *.png -recurse | foreach ($_) { pngout "$_"}
@cliss
cliss / DebugTimer.cs
Created February 2, 2015 19:07
C# Debug Timer
public class DebugTimer : IDisposable
{
private readonly System.Diagnostics.Stopwatch _watch;
private readonly string _blockName;
/// <summary>
/// Creates a timer.
/// </summary>
/// <param name="blockName">Name of the block that's being timed</param>
public DebugTimer(string blockName)
@drmohundro
drmohundro / Get-FrameworkVersions.ps1
Last active May 12, 2022 13:28
PowerShell script to return all installed .NET Framework versions.
<#
.Synopsis
Returns the install .NET Framework versions.
.Description
The script looks through the registry using the notes from the below
MSDN links to determine which versions of .NET are installed.
@anaisbetts
anaisbetts / .gitattributes
Created December 3, 2014 16:26
USE THIS GITATTRIBUTES FOR EVERY NEW PROJECT FOREVER AND EVER
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst 1password
cinst 7zip
cinst 7zip.install
cinst AdobeAIR
cinst adobereader
cinst Atom
cinst markdownpad2
@glennblock
glennblock / contributors.csx
Last active August 29, 2015 14:04
Get contributors for a release via Oktokit
using Octokit;
var client = new GitHubClient(new ProductHeaderValue("scriptcs"))
{
Credentials = new Credentials(user, password)
};
// find all merged PRs
var filter = new PullRequestRequest() { State = ItemState.Closed };
@adamralph
adamralph / notes.csx
Last active August 29, 2015 14:04
Create release notes from GitHub issues with power of scriptcs and Octokit!
var owner = "scriptcs";
var repo = "scriptcs";
var milestone = "v0.10";
var labels = new Dictionary<string, string>{ { "feature", "New" }, { "bug", "Fixed" } };
var username = "adamralph";
var oAuthToken = "secret";
var client = Require<OctokitPack>().CreateWithOAuth("ScriptCs.ReleaseNotesScript", username, oAuthToken);
var issues = client.Issue.GetForRepository(owner, repo, new RepositoryIssueRequest { State = ItemState.Closed, }).Result;
public interface IEmailSender
{
void Send(string recipient, string subject, string htmlBody);
}
public class EmailSender : IEmailSender
{
private readonly IEmailSettings _settings;
public EmailSender(IEmailSettings settings)
@bradwilson
bradwilson / Cacheability.cs
Created January 23, 2014 20:53
Using chaining to create cached results in ASP.NET Web API v2
public enum Cacheability
{
NoCache,
Private,
Public,
}