Skip to content

Instantly share code, notes, and snippets.

View jmreynolds's full-sized avatar

Joe Reynolds jmreynolds

View GitHub Profile
@jmreynolds
jmreynolds / gist:4601281
Last active December 11, 2015 12:29
Method used to set the action collection in a parent view from a Partial View
private void SetParentActions()
{
Actions.Add(new CloseCurrentViewAction(this, beginGroup: true));
Parent.ChildViewActions.Clear();
Parent.ChildViewActions.Add(AddSideToCartAction);
Parent.Actions.Clear();
foreach (IViewAction childViewAction in Parent.ChildViewActions)
Parent.Actions.Add(childViewAction);
Parent.Actions.Add(new CloseCurrentViewAction(Parent, beginGroup: true));
}
@jmreynolds
jmreynolds / Program
Created July 31, 2014 07:01
The main program of the MDB to XML Schema Converter
class Program
{
static void Main(string[] args)
{
var mdbToXml = new MdbToXml();
mdbToXml.GenerateXmlOutput(pathToData: @"C:\Temp\20140728\new.mdb", pathToOutput: @"C:\Temp\20140728\new.xml");
mdbToXml.GenerateXmlOutput(pathToData: @"C:\Temp\20140728\old.mdb", pathToOutput: @"C:\Temp\20140728\old.xml");
}
}
@jmreynolds
jmreynolds / MyDesktop.txt
Last active February 15, 2018 20:16
My BoxStarter Gist - Includes some licensed stuff
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst NotepadPlusPlus.install -y
cinst 7zip -y
cinst Git.install -y
cinst visualstudiocode -y
cinst LastPass -y
@jmreynolds
jmreynolds / FakePersonTests.cs
Last active February 1, 2016 23:20
SImple Injection Example files
public class PersonServiceUnitTests
{
[Test]
public void ShouldUseFake()
{
var factory = new FakeSqlHelperFactory();
var personService = new PersonServiceFourthPass(factory);
var expectedFirst = "Foo";
var expectedLast = "Bar";
@jmreynolds
jmreynolds / Person.cs
Last active February 2, 2016 00:22
C# 6 Features: String Interpolation
public class Person
{
public Person()
{
PersonId = Guid.NewGuid();
}
public Guid PersonId { get; set; }
public string FirstName { get; set; }
@jmreynolds
jmreynolds / Program.cs
Last active February 2, 2016 00:21 — forked from svick/Program.cs
C# 6.0 Features: FormattableString on .Net 4.0
using System;
using System.Globalization;
static class Program
{
private static void Main()
{
double d = 3.14;
IFormattable s = $"{d}";
Console.WriteLine(s.ToString(null, CultureInfo.GetCultureInfo("cs-cz")));
@jmreynolds
jmreynolds / Auto-Properties_Before.cs
Last active February 2, 2016 00:21
C# 6 Features: Auto-Property Initializer Examples
public class Person
{
public Guid PersonId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class Program
{
public static void Main()
@jmreynolds
jmreynolds / 0_reuse_code.js
Created February 1, 2016 23:29
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jmreynolds
jmreynolds / LinkToGist-Embed
Created February 1, 2016 23:48
WordPress Snippets How to embed Gist, things like that. I don't remember these things, so I'm throwing them in here.
Using Gist-Embed currently - I like the way it styles the gists.
https://github.com/blairvanderhoof/gist-embed#other-ways-to-use-gist-embed
90% of the time, I'll do this:
<code data-gist-id="5457644" data-gist-file="example-file2.html"></code>
This might also be useful:
<code data-gist-id="5457668" data-gist-highlight-line="1,3,5"></code>
@jmreynolds
jmreynolds / AccessPersonWithPublicId.cs
Created February 2, 2016 00:11
C# 6 Features: Immutable Auto-Properties
static void RunService()
{
var personService = new PersonService(new SqlHelperFactory());
var person = new Person
{
FirstName = "Joe",
LastName = "Reynolds"
};
var newId = personService.WritePerson(person);
Console.WriteLine(newId);