Skip to content

Instantly share code, notes, and snippets.

View davidisnotnull's full-sized avatar
🛠️
On contract

David Johnson davidisnotnull

🛠️
On contract
View GitHub Profile
@davidisnotnull
davidisnotnull / web.config
Created July 31, 2018 12:57
If Carling made web.configs....
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
@davidisnotnull
davidisnotnull / .gitignore
Created July 31, 2018 13:18
.gitignore for Umbraco sites
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
@davidisnotnull
davidisnotnull / wkhtmltopdf-switches.txt
Created September 4, 2018 09:50
wkhtmltopdf switches
Name:
wkhtmltopdf 0.12.5 (with patched qt)
Synopsis:
wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... <output file>
Document objects:
wkhtmltopdf is able to put several objects into the output file, an object is
either a single webpage, a cover webpage or a table of contents. The objects
are put into the output document in the order they are specified on the
@davidisnotnull
davidisnotnull / openssl-create-csr.txt
Created September 5, 2018 09:09
Create CSR and Key file using OpenSSL command line
openssl req -new -newkey rsa:2048 -nodes -out star_website_com.csr -keyout star_website_com.key -subj "/C=GB/ST=/L=/O=Owner/OU=Department/CN=*.website.com"
@davidisnotnull
davidisnotnull / dockercommands.txt
Last active October 2, 2018 11:17
Docker commands for Windows
#Sourcegraph
docker pull sourcegraph/server
docker run -p 7080:7080 sourcegraph/server
It is then accessible on 127.0.0.1:7080
#Sonarqube
docker pull sonarqube
docker run -p 9000:9000 -p 9092:9092 sonarqube
Is is then accessible on 127.0.0.1:9000
@davidisnotnull
davidisnotnull / profanities.txt
Created November 13, 2018 12:52
List of profanities for input filtering
2 girls 1 cup, 2g1c, 4r5e, 5h1t, 5hit, a$$, a$$hole, a_s_s, a2m, a54, a55, a55hole, acrotomophilia, aeolus, ahole, alabama hot pocket, alaskan pipeline, anal, anal impaler, anal leakage, analprobe, anilingus, anus, apeshit, ar5e, areola, areole, arian, arrse, arse, arsehole, aryan, ass, ass fuck, ass fuck, ass hole, assbag, assbandit, assbang, assbanged, assbanger, assbangs, assbite, assclown, asscock, asscracker, asses, assface, assfaces, assfuck, assfucker, ass-fucker, assfukka, assgoblin, assh0le, asshat, ass-hat, asshead, assho1e, asshole, assholes, asshopper, ass-jabber, assjacker, asslick, asslicker, assmaster, assmonkey, assmucus, assmucus, assmunch, assmuncher, assnigger, asspirate, ass-pirate, assshit, assshole, asssucker, asswad, asswhole, asswipe, asswipes, auto erotic, autoerotic, axwound, azazel, azz, b!tch, b00bs, b17ch, b1tch, babeland, baby batter, baby juice, ball gag, ball gravy, ball kicking, ball licking, ball sack, ball sucking, ballbag, balls, ballsack, bampot, bang (one's) box, bangbros
@davidisnotnull
davidisnotnull / iis-commands.md
Last active May 2, 2019 09:48
Useful IIS commands

All of the following commands must be run in the C:\Windows\System32\inetsrv folder

This command enables pass through of error messages from PHP-FastCGI to IIS when running PHP sites, rather than just throwing a generic 500 message when something goes wrong. Replace sitename with the name of the site in IIS.

appcmd.exe set config "sitename" -section:system.webServer/httpErrors /existingResponse:"PassThrough" /commit:apphost

Install Drush on windows

composer global require drush/drush:8.*
@davidisnotnull
davidisnotnull / bearertoken.cs
Created February 1, 2020 17:02
Add bearer token to web request
var myUri = new Uri(fullpath);
var myWebRequest = WebRequest.Create(myUri);
var myHttpWebRequest = (HttpWebRequest)myWebRequest;
myHttpWebRequest.PreAuthenticate = true;
myHttpWebRequest.Headers.Add("Authorization", "Bearer " + AccessToken);
myHttpWebRequest.Accept = "application/json";
var myWebResponse = myWebRequest.GetResponse();
var responseStream = myWebResponse.GetResponseStream();
if (responseStream == null) return null;
@davidisnotnull
davidisnotnull / CreateAdminUserAndRoles.cs
Last active July 2, 2020 11:20
Creates an Episerver Admin user with appropriate roles on a local db.
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.Logging.Compatibility;
using System.Configuration.Provider;
using System.Web.Security;
namespace MyEpiserverProject.Business.Initialization
{
[InitializableModule]
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]