Skip to content

Instantly share code, notes, and snippets.

View normansolutions's full-sized avatar

Clive Norman normansolutions

View GitHub Profile
@normansolutions
normansolutions / DisableRDPonAD.ps1
Last active August 29, 2015 13:56
For use on blog post: http://www.normansolutions.co.uk/post/PowerShell to secure AD users RDP access
Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
Get-QADUser * -OrganizationalUnit "ou=Your Sub-OU,ou=Your OU,dc=Your LDAP,dc=Your LDAP" |
?{$_.TsAllowLogon -ne $true} |
Set-QADUser -TsAllowLogon $true
CREATE VIEW DBA_RandSView
AS
SELECT TOP (100) PERCENT Sanctions.Sanction
,Pupil.Pu_Surname
,Pupil.Pu_GivenName
,Years.YearDesc
,PupSanction.PupSanDate
,PupSanction.PupSanCount
,PupSanction.PupNewNote
,Staff.UserName
#cookie-bar .cb-enable {
background: $greenDarkening10;
}
#cookie-bar .cb-enable:hover {
background: $green;
}
#cookie-bar .cb-disable {
background: $red;
//Colour Lightening 10%
$blueLighten10:lighten( $blue, 10% );
$redLighten10:lighten( $red, 10% );
$greenLighten10:lighten( $green, 10% );
//Colour Darkening 10%
$blueDarkening10:darken( $blue, 10% );
$redDarkening10:darken( $red, 10% );
$greenDarkening10:darken( $green, 10% );
public static string FingerPrint(string rootRelativePath, string cdnPath = "")
{
if (!string.IsNullOrEmpty(cdnPath) && !HttpContext.Current.IsDebuggingEnabled)
{
return cdnPath;
}
if (HttpRuntime.Cache[rootRelativePath] == null)
{
string relative = VirtualPathUtility.ToAbsolute("~" + rootRelativePath);
string absolute = HostingEnvironment.MapPath(relative);
<rules>
<rule name="fingerprint" stopProcessing="true">
<match url="(.*)(v-[0-9]+/)([\S]+)"/>
<action type="Rewrite" url="{R:1}/{R:3}"/>
</rule>
</rules>
<link rel="stylesheet" href="@CacheBust.FingerPrint("/css/mainStyle.css")" />
<link rel="shortcut icon" href="@CacheBust.FingerPrint("/favicon.ico")" type="image/x-icon" />
<script src="@CacheBust.FingerPrint("/scripts/mainScripts.js")"></script>
var mobile = $('#home_template').hasClass('mobile');
if (!mobile) {
var iPadAgent = navigator.userAgent.match(/iPad/i) === null;
var iPodAgent = navigator.userAgent.match(/iPhone/i) === null;
var AndroidAgent = navigator.userAgent.match(/Android/i) === null;
var webOSAgent = navigator.userAgent.match(/webOS/i) === null;
var hasFlash = false;
if (iPadAgent && iPodAgent && AndroidAgent && webOSAgent) {
@normansolutions
normansolutions / BMILoss.sql
Last active August 29, 2015 14:07
Query for establishing BMI weight loss in iSAMS MIS - compares last two measurements per student and selects where latest is less than previous, displaying total loss and days between. Ideally to be used as base for SSRS Report.
IF OBJECT_ID( 'tempdb..#TempBMI'
)IS NOT NULL
BEGIN
DROP TABLE #tempbmi;
END;
WITH cte
AS ( SELECT txtschoolid ,
txtbmidate ,
intweight ,
@normansolutions
normansolutions / isams-tutorial-groups-mis.config
Created October 21, 2014 15:07
Config file for displaying iSAMS Tutorial Groups in Firefly VLE
<?xml version="1.0" encoding="UTF-8"?>
<database name="YourDBName" friendlyName="iSAMS Tutorial Groups">
<querySets>
<!-- ## tutorial groups relationships ## -->
<querySet guidPrefix="Tutorial">
<!-- Return a list of groups for the specified member guid -->
<groupLists>
<groupList namePrefix="Tutorial Group ">
<query>