Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@nfreear
nfreear / .gitconfig--.npmrc
Last active May 1, 2020 05:27
Per-user ~/.gitconfig and per-REPO/.git/config on OU servers (hence smart HTTPS protocol) — plus .npmrc
# See: http://draconianoverlord.com/2010/03/04/git-config.html
# See: https://github.com/rtomayko/git-sh
# See: https://gist.github.com/502434
# REPO/.git/config
[remote "origin"]
# Generic by default.
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://iet-admin@github.com/IET-OU/pd-open-ac-uk.git
@nfreear
nfreear / drupal-6.x-nice_tags-js-2.diff
Created June 12, 2012 22:23
Drupal 6: Require 2 backspaces to delete tags; don't use tab (accessibility) | Javascript | http://drupal.org/project/nice_tags#nice_tags.js
diff --git a/nice_tags.js b/nice_tags.js
index 5adedd2..c5ae14b 100644
--- a/nice_tags.js
+++ b/nice_tags.js
@@ -92,24 +92,36 @@ function easyTagsListen(input_wrapper) {
// key codes that trigger the tag to be added when pressed
var keyTriggers = [
- 9, // tab
+ /*9, // tab NDF: not tab - keyboard accessibility */
<?php
// generic function to get the contents of an HTML block
function get_inner_html( $node ) {
$innerHTML= '';
$children = $node->childNodes;
foreach ($children as $child) {
$innerHTML .= $child->ownerDocument->saveXML( $child );
}
return $innerHTML;
}
@nfreear
nfreear / drupal-admin--ldap-ldapdata-edit-1.php
Created June 15, 2012 11:03
Drupal ldap_integration: PHP to filter attributes / E-PD / N.D.Freear 15 June 2012
<?php
/* Drupal 6.x ldap_integration: PHP to filter attributes.
* ietatou_pd:admin/settings/ldap/ldapdata/edit/1.edit-attributes-ldapdata-filter-php
*
* N.D.Freear, 15 June 2012.
*
* Don't include this comment or the <-?php line above!
*/
if ($attributes['cn'][0]) {
@nfreear
nfreear / crontab.sh
Created June 15, 2012 16:19
Drupal/ E-PD crontab/ cron file / http://drupal.org/cron
# PD-approval crontab - every 2 hours (5 min past the hour)
# See, http://drupal.org/cron
# (Also, http://drupal.org/project/poormanscron )
#
## crontab -e
5 */2 * * * no_proxy=localhost /usr/bin/wget -O - -q -t 1 http://localhost/cron.php > /dev/null 2>&1
@nfreear
nfreear / orbiter-micro-chat.html
Created June 16, 2012 07:14
Union Platform / OrbiterMicro / NDF, 28 May 2012 / http://www.unionplatform.com/?page_id=1587
<!doctype html><html lang="en"><meta charset=utf-8 /><title>*OUnion client demo</title>
<!--
Union Chat for Javascript - improved..
Copyright N.D.Freear, 28 May 2012
* Accessibility improvements
* URL auto-linking
* Colour
http://unionplatform.com/samples/orbitermicro/UnionChatPart1/chat.html
-->
@nfreear
nfreear / using-merge-subtree.sh
Created July 4, 2012 14:23
How to use the subtree merge strategy - Nick's mods for Drupal 6.x-based E-PD
# http://kernel.org/pub/software/scm/git/docs/howto/using-merge-subtree.html
$ git remote add -f feedsProject --no-tags -t 6.x-1.x http://git.drupal.org/project/feeds.git
$ git merge -s ours --no-commit feedsProject/6.x-1.x <2>
$ git read-tree --prefix=sites/all/modules/contrib/feeds/ -u feedsProject/6.x-1.x <3>
$ git commit -m "Merge remote-tracking branch 'feedsProject/6.x-1.x'.." <4>
$ git pull -s subtree feedsProject 6.x-1.x <5>
@nfreear
nfreear / text-overflow-css.html
Created August 1, 2012 21:42
CSS3 - text-overflow: ellipsis | via quirksmode/PPK and w3schools
<!doctype html><title> CSS3 - text-overflow </title>
<style>
p.test {
border: 1px solid gray;
white-space: nowrap;
width: 35em;
overflow: hidden;
text-overflow: ellipsis;
}
@nfreear
nfreear / piwik-js2.html
Created August 8, 2012 16:17
Piwik Javascript tracking sample page
<!doctype html> <title>*Piwik - Javascript track</title>
<h1>Piwik</h1>
<!-- Piwik -->
<script>
var pkBaseURL =
(("https:" == document.location.protocol) ? "https://localhost:8888/piwik/"
: "http://localhost:8888/piwik/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
@nfreear
nfreear / piwik-img1.html
Created August 8, 2012 16:18
Piwik no-script image tracking sample page
<!doctype html> <title>*Piwik - image tracker</title>
<h1>Piwik</h1>
<h3>'Invisible' 1-pixel GIF</h3>
<!-- Piwik Image Tracker -->
<img src="http://XX-localhost:8888/piwik/piwik.php?idsite=1&amp;rec=1" style="border:0" alt="" />
<!-- End Piwik -->