Skip to content

Instantly share code, notes, and snippets.

View jcansdale's full-sized avatar

Jamie Cansdale jcansdale

View GitHub Profile

npm

  • Packages are published to the OWNER scope
  • Unscoped packages can't be published
@OWNER:registry=https://npm.pkg.github.com
@jcansdale
jcansdale / gradle.md
Last active March 17, 2020 18:37
Gradle experiments

This doesn't work so well:

$ docker run -it --entrypoint bash gradle

So I'm using:

$ docker run -it --entrypoint bash frekele/gradle
@jcansdale
jcansdale / go.js
Last active January 14, 2020 22:36
JavaScript playground
function gooo()
{
console.log('hmmmmmmmmmmmmmmmm');
}
@jcansdale
jcansdale / git-credential-fill.md
Last active December 8, 2019 23:23
Retrieve a GitHub authentication token

Try entering the following in Git Bash:

$ git credential fill
protocol=https
host=github.com

(note the blank line)

@jcansdale
jcansdale / HelloGists.csproj
Created October 9, 2019 08:41
Hello, Gists!
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
</Project>
@jcansdale
jcansdale / DumpProjects.cs
Created February 6, 2019 14:55
Enumerate projects in a solution
using System;
using System.Collections.Generic;
using EnvDTE;
public class Tests
{
[STAThread]
static IList<string> DumpProjects(DTE dte)
{
var projects = new List<string>();
public string FindOutputFilePath(IVsTextManager2 textManager, IVsEditorAdaptersFactoryService adapters)
{
if(textManager.GetActiveView2(1, null, (uint)_VIEWFRAMETYPE.vftCodeWindow, out IVsTextView activeView) == VSConstants.S_OK)
{
var textView = adapters.GetWpfTextView(activeView);
var doc = textView.TextBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
return doc.Project.OutputFilePath;
}
return null;
@jcansdale
jcansdale / Mono.Cecil.cs
Created October 17, 2018 18:13
proj2src Mono.Cecil.csproj Mono.Cecil.cs
#region ProjectInfo.cs
namespace Internal {
//
// Author:
// Jb Evain (jbevain@gmail.com)
//
// Copyright (c) 2008 - 2015 Jb Evain
//
// Licensed under the MIT/X11 license.
//
query {
search(first: 100, type: REPOSITORY, query: "VisualStudio")
{
nodes
{
... on Repository
{
nameWithOwner
object(oid: "ed204a53a72ce1d54556bfcceda6103b926f3ae5")
{
@jcansdale
jcansdale / CodeWindowFromWindowFrame.cs
Created July 19, 2018 11:40
Find IVsCodeWindow associated with a IVsWindowFrame
public static IVsCodeWindow GetCodeWindow(this IVsWindowFrame windowFrame)
{
ErrorHandler.ThrowOnFailure(windowFrame.GetProperty((int)__VSFPROPID.VSFPROPID_DocView, out object docView));
return docView as IVsCodeWindow;
}