Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@nfreear
nfreear / cloudengine-cloudworks-oembed-config.php
Last active October 13, 2015 21:19
Configuration array/hash for jQuery-oEmbed plugin - CloudEngine/ Cloudworks... * Wordpress blogs, Fileviewer embeds.. -- for OLDS-MOOC (#oldsmooc)
<?php
// An array of jQuery-oEmbed options.
// @link http://code.google.com/p/jquery-oembed/
// @link https://bitbucket.org/cloudengine/cloudengine/issue/213
##$_wordpress_oembed = "new $.fn.oembed.OEmbedProvider('wordpress', 'rich', ['__HOST__'], 'http://public-api.wordpress.com/oembed/1.0/?for=CW')";
$config['oembed_options'] = array(
// OU Podcast media player.
'oupodcast' => array(
@nfreear
nfreear / cloudengine-cloudworks-capret-config.php
Created December 11, 2012 10:45
Configuration options for Track OER/ CaPRéT plugin - CloudEngine/ Cloudworks
<?php
// Google Analystics
$config['x_google_analytics'] = FALSE; #TRUE;
$config['google_analytics'] = 'UA-5304738-3'; // Set this to your google analytics code
// CaPReT/ Track OER
$config['x_capret'] = TRUE;
$config['capret_variant'] = 'piwik'; // Or 'ga', or 'classic'
@nfreear
nfreear / cloudengine-cloudworks-dev-locale-config.php
Created December 11, 2012 11:47
Configuration options - adding custom locales - CloudEngine/ Cloudworks / internationalization / i18n
<?php
// Feature flag for internationalisation
$config['x_translate'] = TRUE;
$config['locale_array']= array(
// Danish.
'da' => array(
'name' => 'Dansk/ Danish',
'locales'=> array('da_DK.UTF-8', 'da_DK.utf8'),
@nfreear
nfreear / drupal-theme-oembed-override.css
Created December 14, 2012 09:31
Drupal 6.x theme CSS: override 3rd party oEmbed consumer/client stylesheet (Garland theme) / nfreear / IET-at-OU
/*
Override default oEmbed styles.
See also - 'remove' PHP: https://gist.github.com/1892457
*/
/*div.oembed,*/
.oembed iframe {
margin:0;
padding:0;
float:none;
background:transparent;
<h1><?=t("Join !site-name!")?></h1>
<div id="register">
<p>
<?=t("By creating an account, you agree to our [link-at]Terms and Conditions of Use[/link].",
array('[link-at]' => t_link('about/tandc')))?>
</p>
<?=form_open($this->uri->uri_string(), array('id'=>'register_form', 'class'=>'__h5fm')); /*Uses HTML5 form attributes (BB #115).*/ ?>
<?= validation_errors() ?>
<table>
@nfreear
nfreear / oupod-algo.php
Created December 23, 2012 11:49
Algorithm to create a unique URL for OU audio-visual (OU podcast tracks), version 1 / 24 November 2010.
<?php
/* Algorithm.
*/
ini_set('display_errors', 1);
header('Content-Type: text/plain');
?>
/*
Algorithm to create a unique URL for OU audio-visual (OU podcast tracks), version 1.
(N.D.Freear, 24 nov 2010.)
@nfreear
nfreear / oocharts-google-analytics-1.html
Created January 15, 2013 11:57
OOcharts / Google Analytics Javascript
<!doctype html> <title>*OOcharts / Google Analytics</title>
<style>
body{ font:1em sans-serif; background:#fafafa; margin:1em 2em; }
div,p{ margin:1em 0; }
</style>
<!--<script src="http://oocharts.org/release/current/oocharts.js"></script>-->
<script src="toer/oocharts_2.1/oocharts.js"></script>
<script>
@nfreear
nfreear / scraperwiki_oembed_v1.provider.py
Last active December 11, 2015 05:19
ScraperWiki - oEmbed provider API (my first Python!) -- https://scraperwiki.com/views/scraperwiki_oembed_v1
import scraperwiki
"""
ScraperWiki oEmbed provider API, v1
Copyright 2013-01-16 Nick Freear. All rights reserved.
License: GNU General Public License <http://gnu.org/licenses/gpl-3.0.html>
Usage:
https://views.scraperwiki.com/run/scraperwiki_oembed_v1/?callback=_jsonp12&format=json&url=https%3A//views.scraperwiki.com/run/cloudworks_mindmap/%3FcloudscapeID=2451
@nfreear
nfreear / scraperwiki_oembed_v1.2.provider.py
Last active December 11, 2015 06:08
ScraperWiki oEmbed provider API v1.2.
import scraperwiki
"""
ScraperWiki oEmbed provider API, v1.2.
Copyright 2013-01-16 Nick Freear. All rights reserved.
License: GNU General Public License <http://gnu.org/licenses/gpl-3.0.html>
Usage:
https://views.scraperwiki.com/run/scraperwiki_oembed_v1/?callback=_jsonp12&format=json&url=https%3A//views.scraperwiki.com/run/cloudworks_mindmap/%3FcloudscapeID=2451
@nfreear
nfreear / git-hook_prepare-commit-msg.php
Last active December 11, 2015 13:29
Git prepare-commit-msg hook to append an issue tracker URL to commit messages (PHP).
#!/C/xampp/php/php
<?php
#!/usr/bin/env php
/**
* Git prepare-commit-msg hook to append an issue tracker URL to commit messages.
*
* Git hooks on Windows: Ensure that the path to PHP is added to the %PATH% variable, and run `git commit` via the Bash shell.
*
* Usage: `git commit -em "Bug #123" <FILE>`
*