Skip to content

Instantly share code, notes, and snippets.

View MattJeanes's full-sized avatar
🏳️‍🌈

Matt Jeanes MattJeanes

🏳️‍🌈
View GitHub Profile
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:43434/",
"sslPort": 44301
}
},
"profiles": {
@MattJeanes
MattJeanes / launch.ps1
Created October 22, 2018 13:55
Manual launching and handling of IISExpress via command line/launchSettings.json
param([string]$Config, [string]$Site, [switch]$Child=$false)
if(-not $Child){
Write-Host "Starting child process"
$exe = "powershell"
$args = @("-File `"$($MyInvocation.MyCommand.Definition)`"", "-Config `"$Config`"", "-Site `"$Site`"", "-Child")
$args
Start-Process $exe -ArgumentList $args -Wait
}else{
try{
@MattJeanes
MattJeanes / DeleteExcludedFiles.ps1
Last active September 6, 2018 17:21 — forked from mikesigs/DeleteExcludedFiles.ps1
PowerShell Script to Find (and delete) all excluded files in a Visual Studio Solution
$Solution = "C:\_git\Mercury\Mercury.sln"
[switch]$DeleteFromDisk = $true
$ErrorActionPreference = "Stop"
$solutionDir = Split-Path $Solution | % { (Resolve-Path $_).Path }
cd $solutionDir
$projects = Select-String -Path $Solution -Pattern 'Project.*"(?<file>.*\.csproj)".*' `
| % { $_.Matches[0].Groups[1].Value } `
@MattJeanes
MattJeanes / webpack.config.node.ts
Created July 24, 2017 12:30
Webpack config for serverside node applications with hacks for TypeORM and SQLite3
import { CheckerPlugin } from "awesome-typescript-loader";
import * as path from "path";
import * as webpack from "webpack";
module.exports = (env: any) => {
const prod = env && env.prod as boolean;
console.log(prod ? "Production" : "Dev" + " main build");
const analyse = env && env.analyse as boolean;
if (analyse) { console.log("Analysing build"); }
const outputDir = "./";
@MattJeanes
MattJeanes / gulpfile.js
Created January 18, 2017 22:01
Wallboard gulpfile
/// <binding BeforeBuild='build' Clean='clean' ProjectOpened='watch' />
var gulp = require('gulp');
var sass = require('gulp-sass');
var changed = require('gulp-changed');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var plumber = require('gulp-plumber');
var path = require('path');
var del = require('del');
@MattJeanes
MattJeanes / e2names.lua
Last active August 29, 2015 14:26
Quick one-liner to print the names, op counts, time-benches and player info of all currently spawned E2s
for k,v in pairs(ents.FindByClass("gmod_wire_expression2")) do print(v.name,math.Round(v.context.prfbench).." ops",math.Round(v.context.timebench*1000000).." us", v.context.player:Nick(), v.context.player:SteamID()) end
@MattJeanes
MattJeanes / evolve_mass_privileges.lua
Last active August 29, 2015 14:13
Can be used to mass set/unset privileges
local thing=""
for k,v in pairs(evolve.privileges) do
if string.sub(v,0,thing:len())==thing then
local privilege = v
for k,v in pairs(evolve.ranks) do
local rank = k
if v.Immunity>=15 and v.Immunity < 99 then
if ( !table.HasValue( evolve.ranks[ rank ].Privileges, privilege ) ) then
table.insert( evolve.ranks[ rank ].Privileges, privilege )
end
@MattJeanes
MattJeanes / purge.lua
Last active August 29, 2015 14:04
Purge script for Garry's Mod, based on film 'The Purge'.
-- Purge. Written by Dr. Matt, initial version/idea by Paft.
AddCSLuaFile()
if SERVER then
util.AddNetworkString("purge")
local purge=false
local cooldown=false
local cooldowntime=15
@MattJeanes
MattJeanes / linkfilter_bypass.user.js
Last active August 29, 2015 14:04
Bypasses the steam link filter
// ==UserScript==
// @name Steam linkfilter bypass
// @namespace http://www.mattjeanes.com/
// @description Automatically bypasses the steam linkfilter.
// @include http*://steamcommunity.com/linkfilter/?url=*
// @run-at document-start
// ==/UserScript==
var str = window.location.href
var search = "?url="
@MattJeanes
MattJeanes / KickCommand.lua
Created March 1, 2014 02:49
Adds a chat command to kick a player, only works if you're admin or super admin.
hook.Add("PlayerSay", "kick", function(ply,text)
if ply:IsAdmin() or ply:IsSuperAdmin() then
local t=string.Explode(" ", text)
if t and t[1] and t[1]:lower()=="!kick" then
if t[2] and string.len(t[2])>0 then
local n=t[2]
local pl={}
for k,v in pairs(player.GetAll()) do
if string.find(v:Nick():lower(), n:lower()) then
table.insert(pl,v)