Skip to content

Instantly share code, notes, and snippets.

View nickfloyd's full-sized avatar
🎯
Taking on problems one byte at a time

Nick Floyd nickfloyd

🎯
Taking on problems one byte at a time
View GitHub Profile
@bradwilson
bradwilson / vs2017.ps1
Last active January 23, 2018 19:05
VS 2017 PowerShell script; if you need invoke-cmdscript, it's here: https://gist.github.com/bradwilson/3fca203370d54304eff1cce21ffc32aa
param(
[string]$edition,
[switch]$noWeb = $false
)
# Try and find a version of Visual Studio in the expected location, since the VS150COMNTOOLS environment variable isn't there any more
$basePath = join-path (join-path ${env:ProgramFiles(x86)} "Microsoft Visual Studio") "2017"
if ((test-path $basePath) -eq $false) {
write-warning "Visual Studio 2017 is not installed."
@dasMulli
dasMulli / GitVersionedProject.csproj
Last active March 6, 2017 23:25
Demo of using Git branch with mapping + commit count to set version properties in csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<GitBranchToReleaseLabelMapping Include="master" ReleaseLabel="rtm" />
<GitBranchToReleaseLabelMapping Include="develop" ReleaseLabel="beta" />
@chadman
chadman / gist:1180f830fd4a2392c4e8
Created November 7, 2015 04:17
Given a specific amount of money on hand, calculate the CC bills to pay off to save the most amount of money a month
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace budget {
public class Program {
static void Main(string[] args) {
var debt = new DebtCalculation(500);
@lfender6445
lfender6445 / gist:9919357
Last active June 23, 2024 09:14
Pry Cheat Sheet

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@anaisbetts
anaisbetts / doc.md
Last active December 29, 2015 07:29
The smallest number of WinDbg commands you can know to Do Stuff With VS

File => Attach To Process, pick devenv.exe

First, fix the symbols and shit

.symfix
.reload
.loadby sos clr
@cheeaun
cheeaun / js-error-logging-services.md
Last active December 10, 2023 13:04
JavaScript error logging services
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@haacked
haacked / TestHelper.cs
Created January 14, 2012 07:25
String Comparison Unit Test Helper
public static class TestHelpers
{
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue)
{
ShouldEqualWithDiff(actualValue, expectedValue, DiffStyle.Full, Console.Out);
}
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, DiffStyle diffStyle)
{
ShouldEqualWithDiff(actualValue, expectedValue, diffStyle, Console.Out);
@brianlow
brianlow / FindConflictingReferences.cs
Created January 3, 2012 03:04
Find conflicting assembly references
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]
@nickfloyd
nickfloyd / Remove the last pushed commit
Created February 3, 2011 14:48
For all of us boneheads out there that push accidental commits
git push -f origin HEAD\^:master
so commit history in the remote looks like:
Had to clean up some things from the merge
nickfloyd (author)
January 26, 2011
commit 4bcce9878c454ba5583c
tree e6f4cffa47b1301a4cfc