Skip to content

Instantly share code, notes, and snippets.

Jon Davis stimpy77

View GitHub Profile
@stimpy77
stimpy77 / Javascript Injector script.js
Created Jun 29, 2020
Remove unwanted link in Facebook sidebar
View Javascript Injector script.js
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 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.