Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
<!DOCTYPE html>
<html>
<!--
John Snyders
This sample including the JavaScript code is in the Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>High Contrast Mode Test</title>
@nfreear
nfreear / git-hook_pre-commit_lint.php
Last active October 15, 2015 04:05
Git pre-commit hook to run PHP lint, check for [CR] Mac-only line endings..
#!/C/xampp/php/php
<?php
#!/usr/bin/env php
/**
* Git pre-commit hook to run php lint.
*
* Git hooks on Windows: Ensure that the path to PHP is added to the %PATH% variable, and run `git commit` via the Bash shell.
*
* @copyright 2012-04-30 N.D.Freear.
* @license MIT
@nfreear
nfreear / ndrupalgit.php
Created May 1, 2012 11:56
Quickly checkout a bunch of Drupal contributed modules on *nix, or git-describe sub-directories.
#!/usr/bin/env php
<?php
/**
* Nick's Drupal Git CLI.
* Quickly checkout a bunch of Drupal contributed modules on Redhat 6, or git-describe sub-directories.
*
* > php ../../../../../ndrupalgit.php
*
* Issues: views?
*
@nfreear
nfreear / phplint.php
Created May 8, 2012 14:43
Nick's quick php-lint
<?php
/**
* Nick's quick php-lint.
*
* > php ../../../../../phplint.php
*
* Copyright 2012-05-08 N.D.Freear.
*/
$dir = getcwd();
@nfreear
nfreear / Mercurial.ini
Created May 10, 2012 14:12
Mercurial.ini / .hgrc - HG configuration file
# Mercurial configuration.
[http_proxy]
#host = wwwcache.open.ac.uk:80
[ui]
username = Nick Freear <ME@example.org>
# Editor - I'll use vi for now!
@nfreear
nfreear / oudrupal.php
Created May 10, 2012 16:08
Parse the OU Drupal supported modules Wiki page, and extract project names and hopefully Git tags
<?php
/**
* Parse the OU Drupal supported modules Wiki page, and extract project names and hopefully Git tags.
*
* $ git tag -l "6.x-2.*"
*
* N.D.Freear, 2012-05-10.
*/
$url = 'http://www.open.ac.uk/wikis/drupal/Drupal_supported_modules_(6.21)';
@nfreear
nfreear / oudrupal-2.php
Created May 15, 2012 10:59
Quickly checkout a bunch of Drupal contributed modules on *nux by branch or tag, and git-describe sub-directories
#!/usr/bin/env php
<?php
/**
* Nick's OU-Drupal Git CLI.
* Quickly checkout a bunch of Drupal contributed modules on Redhat 6, by branch or tag, and git-describe sub-directories.
*
* > php ../../../../../ndrupalgit.php
*
* Issues: views?
*
#!/usr/bin/env bash
# Creating a svn.authorsfile when migrating from subversion to git
# By Josh Nichols September 07, 2008
# http://technicalpickles.com/posts/creating-a-svn-authorsfile-when-migrating-from-subversion-to-git
# Run this inside an subversion checkout. It outputs a template for the svn.authorsfile to the console..
authors=$(svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2 }' | sort | uniq)
for author in ${authors}; do
echo "${author} = NAME <USER@DOMAIN>";
@nfreear
nfreear / parser_ical.dateapi.inc
Created June 6, 2012 15:37
Drupal iCal parser plugin - HOOK_parser_ical_filter_item / ou_ical / E-PD / N.D.Freear 6 June 2012
<?php
// $Id$
/**
* @file
* parser_ical include for actually parsing feed.
*/
/**
* Parse iCal feeds.
@nfreear
nfreear / template-anon.php
Created June 6, 2012 20:34
HTML5 templates and forms using PHP anonymous functions.
<?php
/*
PHP 5.3+ "A practical example of anonymous functions could be a.. template system."
Copyright N.D.Freear 7 June 2012.
..
lennymail at nospam dot gmail dot com 05-Oct-2011 10:40
http://php.net/manual/en/functions.anonymous.php#106046
*/
error_reporting(E_ALL); ini_set('display_errors', 1);