Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@nfreear
nfreear / wc10.html
Created October 5, 2011 09:11 — forked from nithinbekal/wc10.html
JavaScript Countdown timer / small / with fixes
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8" />
<title>Countdown Timer</title>
<div id="countdown_time"> </div>
<script src="wc10.js" type="text/javascript" charset="utf-8"></script>
</html>
@nfreear
nfreear / parent.html
Created October 5, 2011 11:15
#moodle4-9 book widget
<!DOCTYPE html><title>#moodle4-9 book widget</title>
<!--Begin embed-->
<div
id="moodle4-9-book-embed"
about="http://packtpub.com/moodle-2-for-teaching-4-9-year-olds-beginners-guide/book"
xmlns:dc="http://purl.org/dc/elements/1.1/"
property="dc:title" content="Moodle 2 for Teaching 4-9 Year Olds Beginner's Guide" >
<i property="dc:author" content="Nicholas Freear"></i>
@nfreear
nfreear / ouplayer.po
Created October 7, 2011 13:44
OU player/ OU embed language template (PO/POT format)
# Most recent version, http://embed.open.ac.uk/translate
#
# OU player/ OU embed language template.
# Lang: en
# Copyright (C) 2011 The Open University. All rights reserved.
# This file is distributed under the same license as the ouplayer package.
# Nick Freear <N.D.Freear+@+open.ac.uk>, 2010.
#
#, fuzzy
msgid ""
@nfreear
nfreear / favicon.css
Last active July 9, 2016 02:51
CSS3 selectors to add icons (favicons) to a user-profile list
/* CSS3 selectors. */
.pr li{ margin:2px 0; }
.pr [href*=":"]{padding-left:28px; /*24px*/ background-repeat:no-repeat; background-position:left; background-size: 16px 16px; }
.pr [href*="open.ac.uk"]{background-image:url(http://www3.open.ac.uk/favicon.ico) /*http://openlearn.open.ac.uk/favicon.ico*/ }
.pr [href*="cloudworks.ac.uk"]{background-image:url(http://cloudworks.ac.uk/themes/cloudworks/favicon.ico)}
.pr [href*="facebook.com"]{background-image:url(http://facebook.com/favicon.ico)}
.pr [href*="linkedin.com"]{background-image:url(http://www.linkedin.com/favicon.ico)}
.pr [href*="google.com"]{background-image:url(http://www.google.com/favicon.ico)}
@nfreear
nfreear / feedburner-subscribe.html5.html
Created January 13, 2012 10:51
HTML5 FeedBurner subscription form - <label>.. <input type=email required..> | http://freear.org.uk/#feedburner
<!DOCTYPE html>
<form
id="feedburner"
style="border:1px solid #ccc;padding:3px;text-align:center;"
action="http://feedburner.google.com/fb/a/mailverify"
method="post"
target="popupwindow"
onsubmit=
"window.open('http://feedburner.google.com/fb/a/mailverify?uri=nickfreearblog', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"
@nfreear
nfreear / blackout.html
Created January 18, 2012 22:25
My Stop-SOPA / PIPA blackout solution - Javascript + CSS + plain old HTML
<!DOCTYPE html>
<!--
My Stop-SOPA blackout solution.
Copyleft 2012-01-18 Nicholas Freear.
License: http://gnu.org/licenses/lgpl.html
Source: https://gist.github.com/gists/1636217
-->
<style>
body.do-blackout, .do-blackout #wrapper{margin-top:39em;}
@nfreear
nfreear / iframe-blackout.drupal-block.html
Created January 19, 2012 10:32
Adding SOPA blackout to a Drupal Gardens - Javascript + Iframe - by Jacob Singh.name, Zachstronaut.
<script>
/*!
* Javascript-iframe (Drupal) SOPA-blackout solution.
*
* authors: Jacob Singh, Zachstronaut, Nick Freear, 2012-01-17.
* help: http://jacobsingh.name/content/adding-sopa-blackout-drupal-gardens
* via: http://drupal.org/planet
*/
(function blackout(){
var a = new Date,
<!DOCTYPE html><html lang="en"><meta charset="utf-8" />
<!--
N.D.Freear, 27 January 2012.
1. Converted to HTML5 doctype..
* no [head] or [body] (the browsers fix this for us, now that HTML5 defines/ standardizes parsing rules),
* removed type=text/javascript, type=text/css
* removed instructions
- this reduces clutter!
@nfreear
nfreear / debug-via-header.php
Created January 31, 2012 17:15
Output a PHP string or expression as a HTTP header / Drupal
<?php
/**If a 'debug' parameter is set, output a PHP string or expression, probably as a HTTP header.
*
* Inspired by OUVLE ouauth module, and FirePHP.
*
* @param mixed $exp A PHP string or expression.
* @copyright 2012-01-31 N.D.Freear.
*/
function _MY_DRUPAL_MODULE_debug($exp) {
// For Drupal, try variable_get().
@nfreear
nfreear / my-ajax-debug.drupal.php
Last active September 30, 2015 03:17
If a debug parameter variable is set, output PHP expressions in HTTP headers / Drupal.
<?php
<?php
ini_set( 'display_errors', 1);
error_reporting( E_ALL );
//header( 'Content-Type: text/plain');
function my_test() {