Skip to content

Instantly share code, notes, and snippets.

@stimpy77
stimpy77 / Javascript Injector script.js
Created June 29, 2020 17:09
Remove unwanted link in Facebook sidebar
function clearLeftistPropaganda() {
// remove Lift Black Voices tag on left sidebar
var aTags = document.getElementsByTagName("a");
for(var t in aTags) {
var tag = aTags[t];
if (tag.getAttribute && tag.getAttribute("data-testid") === "left_nav_item_Lift Black Voices") {
tag.parentElement.removeChild(tag);
}
}
}
@stimpy77
stimpy77 / AspNetMvcRazorEmail.cs
Created December 1, 2015 05:44
Send e-mail from ASP.NET MVC Razor View
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 August 29, 2015 14:27
How to richly enable a PowerShell script in a C# project to run in MSBuild

#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>
    
@stimpy77
stimpy77 / repl.js
Created August 27, 2014 06:04
REPL for nodeJS as function of app
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, '')) === '') {