Skip to content

Instantly share code, notes, and snippets.

View pmachapman's full-sized avatar

Peter Chapman pmachapman

View GitHub Profile
@kking124
kking124 / configure-iis.ps1
Last active July 25, 2022 15:19
Configuration Script to Secure Public IIS Server
# configure-iis.ps1
# Version: 1.2
# Author: kking124 (https://github.com/kking124)
#
# Copyright 2016, 2017
#
# License: MIT
# .SYNOPSIS
# Tries to configure IIS as a minimal, secure installation on Windows Server 2008 and later
#
@Gr8Gatsby
Gr8Gatsby / changeAppTitleBarColors.js
Created June 30, 2015 21:43
This Gist shows how to set the application titlebar colors. There is a helper function that accepts an HTML hexString and converts it to an RGBA color object for Windows.
/*
This function expects two hexStrings and relies on hexStrToRGBA to convert
to a JSON object that represents RGBA for the underlying Windows API to
understand.
Examples of valid values:
setAppBarColors('#FFFFFF','#000000');
setAppBarColors('#FFF','#000');
setAppBarColors('FFFFFF','000000');
setAppBarColors('FFF','000');
@trentsnippets
trentsnippets / SS_ContactForm
Last active February 8, 2016 00:02
Create a contact form in Silverstripe where submissions are emailed to admin and saved to database. There are 3 Silverstripe files included in this gist.
<?php
/** Important: When adding a second form to a website the second ModalAdmin extention would not function until I added it's
* Tested: 3.0
* name into the same $managed_models array as the first. I was then able to take it out and have it work on it's own.
* ContactPage.php
* This is all the logic for the Contact page.
*/
class ContactPage extends Page
{
@Lekensteyn
Lekensteyn / fix-UBIF-typo.dsl
Created November 9, 2012 16:39
ACPI UBIX fix for Toshiba Satellite L750D
/*
* ACPI UBIX fix for Toshiba Satellite L750D
* https://bbs.archlinux.org/viewtopic.php?id=152543
*
* Symptoms:
* ACPI Exception: AE_AML_PACKAGE_LIMIT, Index (0x0000000000000011) is beyond end of object (20120320/exoparg2-418)
* ACPI Error: Method parse/execution failed [\_SB_.BAT1.UBIX] (Node ffff880203e8a168), AE_AML_PACKAGE_LIMIT (20120320/psparse-536)
* ACPI Error: Method parse/execution failed [\_SB_.BAT1._BIX] (Node ffff880203e8a0f0), AE_AML_PACKAGE_LIMIT (20120320/psparse-536)
* ACPI Exception: AE_AML_PACKAGE_LIMIT, Evaluating _BIX (20120320/battery-419)
*
@guybedford
guybedford / jquery.ajaxqueue.js
Created April 23, 2012 12:12
jQuery AJAX queues
/*
Allows for ajax requests to be run synchronously in a queue
Usage::
var queue = new $.AjaxQueue();
queue.add({
url: 'url',
@jpoehls
jpoehls / BaseController.cs
Created December 2, 2011 19:38
Newtonsoft Json Results for MVC
using System;
using System.Linq;
using System.Web.Mvc;
public abstract class BaseController : Controller
{
protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding)
{
return new JsonNetResult
{