Skip to content

Instantly share code, notes, and snippets.

View charlesroper's full-sized avatar
🌱

Charles Roper charlesroper

🌱
View GitHub Profile
<?php
/**
* Implements template_process_html().
*/
// Remove Query Strings from CSS filenames (CacheBuster)
function MYTHEME_process_html(&$vars) {
$vars['styles'] = preg_replace('/\.css\?[^"]+/','.css', $vars['styles']);
}
@charlesroper
charlesroper / LeapTest.cs
Created February 5, 2015 11:49
LeapTest.cs
using NUnit.Framework;
[TestFixture]
public class LeapTest
{
[Test]
public void Valid_leap_year()
{
Assert.That(Year.IsLeap(1996), Is.True);
}
@charlesroper
charlesroper / poshgit-error.txt
Last active August 29, 2015 14:17
Chocolatey poshgit install error.
PS C:\Users\Charles> cinst poshgit
!!ATTENTION!!
The next version of Chocolatey (v0.9.9) will require -y to perform
behaviors that change state without prompting for confirmation. Start
using it now in your automated scripts.
For details on the all new Chocolatey, visit http://bit.ly/new_choco
Chocolatey (v0.9.8.33) is installing 'poshgit' and dependencies. By installing you accept the license for 'poshgit' and each dependency you are installing.
poshgit v0.5.0.201401009
$scope.gridOptions = {
enableFiltering: true,
showGridFooter: true,
enableColumnResizing: true,
columnDefs: [
{ field: "ContactNumber", displayName: "ContactNumber", enableCellEdit: false, cellTooltip: true, width:"*" },
{ field: "OrganisationName", displayName: "Organisation", enableCellEdit: false, cellTooltip: true, width:"*" },
{ field: "LastStartDate", displayName: "Start Date", enableCellEdit: false, cellFilter: dateFilter, width:"*" },
{ field: "Venue", enableCellEdit: false },
{
@charlesroper
charlesroper / gist:65931
Created February 17, 2009 20:03
Method to detect whether we are running from an elevated command-prompt under Vista/Win7 or as part of the local Administrators group in WinXP.
#
# Method to detect whether we are running from an elevated command-prompt
# under Vista/Win7 or as part of the local Administrators group in WinXP.
#
def elevated?
whoami = `whoami /groups` rescue nil
if whoami =~ /S-1-16-12288/
true
else
admin = `net localgroup administrators | find "%USERNAME%"` rescue ""
From ffc228ef071f2a0bac2838d8451ad1f07c090701 Mon Sep 17 00:00:00 2001
From: Charles Roper <charles.roper@gmail.com>
Date: Thu, 30 Jul 2009 20:38:04 +0100
Subject: [PATCH] Added option to command-line tool for wrapping attribs with double-quotes
---
lib/haml/exec.rb | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb
var mult1 =
from m in Enumerable.Range(1, 999)
where m % 3 == 0 || m % 5 == 0
select m;
Console.WriteLine(mult1.Sum());
Console.WriteLine((from m in Enumerable.Range(1, 999) where m % 3 == 0 || m % 5 == 0 select m).Sum());
var mult2 = Enumerable.Range(1, 999)
.Where(m => m % 3 == 0 || m % 5 == 0)
> rake spec
(in D:/Temp/rad_s3)
Running Integration Spec Task
C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/bin/ruby.exe -I "C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/cucumber-0.3.99/lib;lib" "C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/cucumber-0.3.99/bin/cucumber" --format progress C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/content_negotiation.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/layouts_management.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/pages_management.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/snippets_management.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/feature
> rake spec
(in D:/Temp/rad_s3)
Running Integration Spec Task
C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/bin/ruby.exe -I "C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/cucumber-0.3.99/lib;lib" "C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/cucumber-0.3.99/bin/cucumber" --format progress C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/content_negotiation.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/layouts_management.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/pages_management.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/features/admin/snippets_management.feature C:/Users/charlesr/Tools/Ruby/ruby-1.8.6-p383-i386-mingw32/lib/ruby/gems/1.8/gems/radiant-0.8.1/feature
@charlesroper
charlesroper / TaxonDeterminationUpdate.xml
Created January 14, 2010 18:31
Adds a determination to every occurrence of taxa found in a specified CSV. The taxa must be defined in a column called 'Taxon_Name'.
<?xml version="1.0" ?>
<!--
XML Batch Update by Mike Weideli of Littlefield Consultancy
http://www.lfield.co.uk
January 2010
Modifications by Charles Roper of Sussex Biodiversity Record Centre
http://sxbrc.org.uk
January 2010