Skip to content

Instantly share code, notes, and snippets.

Jon Davis stimpy77

Block or report user

Report or block stimpy77

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stimpy77
stimpy77 / AspNetMvcRazorEmail.cs
Created Dec 1, 2015
Send e-mail from ASP.NET MVC Razor View
View AspNetMvcRazorEmail.cs
public class EmailController : Controller
{
// GET: Default
[Route("")]
public ActionResult Index()
{
return RedirectToAction(nameof(SendEmail), new
{
To = "Jon Davis <jon@jondavis.net>",
From ="Phil Whiffenfarts <philwhiffenfarts@gmail.com>",
@stimpy77
stimpy77 / PowerShell_via_MSBuild.md
Last active Aug 29, 2015
How to richly enable a PowerShell script in a C# project to run in MSBuild
View PowerShell_via_MSBuild.md

#How to richly enable a PowerShell script in a C# project to run in MSBuild

  1. Open the .csproj file in Notepad++ (or, right-click the project, choose "Unload Project", then right-click it again and choose "Edit")

  2. Paste the following before the </Project> tag at the end:

     <UsingTask TaskName="InvokePowerShell" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll">
       <ParameterGroup>
           <ScriptFile ParameterType="System.String" Required="true" />
         </ParameterGroup>
         <Task>
    
@stimpy77
stimpy77 / repl.js
Created Aug 27, 2014
REPL for nodeJS as function of app
View repl.js
var readline = require('readline');
var trustedEval = eval;
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.prompt(true);
rl.on('line', function (cmd) {
if (((cmd || '').replace(/\s*/g, '')) === '') {
You can’t perform that action at this time.