Skip to content

Instantly share code, notes, and snippets.

View booyaa's full-sized avatar
🏠
Dayjob

Mark Sta Ana booyaa

🏠
Dayjob
View GitHub Profile
@booyaa
booyaa / porter-stemmer.js
Created April 8, 2013 17:30
porter-stemmer test
var stemmer = require('porter-stemmer').stemmer;
var sentence = "bar. barred. bar it! barred! go bar yourself! foo-head";
var blockList = ['foo', 'bar'];
function fillString(size, char) {
str = "";
for(var i=0; i<size; i++) {
str += char;
@booyaa
booyaa / ghcopy.txt
Created April 19, 2013 17:21
gist created by github.com/dscape/ghcopy
var request = require('request');
request('http://localhost/~booyaa/trigger-404.html', function (err, response, body) {
if (err) {
throw err;
}
if (response.statusCode === 404) {
// throw 'file not found';
throw new Error("file not found");
}
@booyaa
booyaa / gist:5433957
Last active December 16, 2015 12:19
Remote debugging of ASP apps hosted on IIS
  1. Remote IIS server: run (as Admin because you need debug privs) msvsmon.exe (Prog Files\VS2010\Common7\IDE\RemoteDebugger\x64|x32)
  2. Make a note the Remote Debugger Monitor Server Name (usually looks like DOMAIN@USERID@SERVERNAME)
  3. Local Visual Studio: Debug > Attach Process > Qualifier = Remote Debugger Monitor Server Name
  4. Refresh and attach to the w3wp.exe process that closely matches your config type: x64, Managed, .NET 4 etc. You'll know you've got the correct process if your breakpoints are active (red dot vs. red circle and warning that breakpoint will not be hit).

Source: http://www.codeproject.com/Articles/38132/Remote-IIS-Debugging-Debug-your-ASP-NET-Applicatio

@booyaa
booyaa / azurify.md
Created May 20, 2013 17:10
how to get your existing node.js apps working on azure if you use don't server.js in the root

let's assume that package.json looks like this

{
  "name": "booyaalolwut",
  "version": "6.6.6",
  "description": "witty description here",
  "scripts": {
    "start": "node express/index.js"
},

####how to dump xml

var xmldoc=new ActiveXObject("MSXML2.DOMDocument.3.0");
xmldoc.loadXml("<root><your>mum</your></root>");
alert(xmldoc.documentElement.xml);
@booyaa
booyaa / html-email-cid.md
Last active December 18, 2015 02:39
embedding an image in html emails using content ids(olde) - works in lotus notes 6.5 or better

you'll need the usual mail headers (from, to, subject...)

Content-Type: multipart/related;
 boundary="=_BlatBoundary-OKWyUQCkIiUpdCVSJtFV4"


--=_BlatBoundary-OKWyUQCkIiUpdCVSJtFV4
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
@booyaa
booyaa / html-email-datauri.md
Created June 5, 2013 10:19
embedding an image in html emails using a datauri - works in lotus notes 8 or better

you'll need the usual mail headers (from, to, subject...)

Content-Type: text/html;
 charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<title>wibble</title>
@booyaa
booyaa / EFandOracle.md
Created June 7, 2013 11:07
Oracle + EF = BFF

Assumptions Oracle drivers are already configured. ODAC maybe a little different...

###Install EF

PM > Install-Package EntityFramework

###Add a connection to Oracle Server Explorer > Add new database connection (we'll assume TNSNAMES is configured correctly) Change the data source to Oracle (obvs)

@booyaa
booyaa / RegEdit.md
Last active December 18, 2015 08:39 — forked from anonymous/gist:5755867
fixing regedit when security tab and appwiz.cpl are missing or disabled.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall

Toggle value to 0 to remove restriction. You'll lose these settings when your profile or policy are refreshed.