Skip to content

Instantly share code, notes, and snippets.

@NickDimmock
NickDimmock / QR code bookmarklet (modified)
Last active December 15, 2015 12:49
A modified version of https://github.com/gdovicak/QR-Code-Bookmarklet that uses encodeURIComponent() instead of escape(), so that + symbols are correctly encoded (otherwise they're encoded as spaces). Minified version is on line 1, followed by the full code.
var QR=function(){var _this=this;var width=400;var height=400;_this.div=null;baseQRUrl='https://chart.googleapis.com/chart?chs='+width+'x'+height+'&cht=qr&chl=';_this.appendDiv=function(){_this.div=document.createElement('div');_this.div.setAttribute('id','qr-container');_this.div.setAttribute('style','position: absolute; top: 0; left: 0; margin:20px; border-radius: 15px; background-color: #444444;padding:10px; z-index: 1000');_this.div.appendChild(getImage());_this.div.onclick=_this.close;document.getElementsByTagName('body')[0].appendChild(_this.div)};function getImage(){var img=document.createElement('img'),imgSrc=_this.GetQRSrc(_this.GetCurrentPageEncoded());img.setAttribute('src',imgSrc);return img}_this.GetCurrentPageEncoded=function(){return encodeURIComponent(document.URL)};_this.GetQRSrc=function(url){return baseQRUrl+url};_this.close=function(){_this.div.parentNode.removeChild(_this.div)}};var qr=new QR();qr.appendDiv();
var QR = function () {
var _this = this;
var width = 400;
var heig
@NickDimmock
NickDimmock / NECTARCoversheetBookmarklet.js
Last active December 17, 2015 15:58
Bookmarklet to reformat a NECTAR / ePrints item page into a coversheet. Requires jQuery - rather than include it here I recommend using http://benalman.com/code/test/jquery-run-code-bookmarklet/ to add the necessary code and generate a bookmarklet link.
var title=$(".ep_tm_pagetitle").text();
// Using .first() for Creators will skip the Corporate Creators info:
var creators=$("th:contains('Creators:')").first().next().text();
/*
We can get citation data from the eprints.citation metadata tag, but it won't be formatted:
var citation=$("meta[name='eprints.citation']").attr("content");
The in-page citation is formatted, but doesn't have any semantic markup, so it has to be filtered out.
*/
var citation=$(".ep_summary_content_main .ep_block").filter(":first").html();
var type=$("meta[name='DC.type']").attr("content");
@NickDimmock
NickDimmock / uon-detect-old-links.js
Created May 31, 2013 13:20
Bookmarklet source (requires jQuery via http://benalman.com/code/test/jquery-run-code-bookmarklet/) to detect various old / bad links on the new UoN website. Turns matching links red and appends a list of matches to the end of the page.
@NickDimmock
NickDimmock / e-theses-and-copyright.md
Last active August 29, 2015 13:56
A collection of resources on copyright considerations for electronic theses in institutional repositories.
@NickDimmock
NickDimmock / index.html
Last active April 2, 2024 06:36
A tool to help with sample slice calculation for the Analog Rytm drum machine.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Analog Rytm: sample slice calculator</title>
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
<style>
body {
font-family: 'Roboto', Helvetica, Arial, sans-serif;
font-size: 1.2em;
@NickDimmock
NickDimmock / index.html
Last active December 16, 2019 09:22
TUNDRA search download fix
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>TUNDRA download fix</title>
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism-coy.min.css" integrity="sha256-1VOeW3bLzHmS11IR0Cl73suNyhliqnse4BTuwGs4IUg=" crossorigin="anonymous" />
<style>
@NickDimmock
NickDimmock / index.html
Created November 4, 2018 17:04
Scrambler
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="scripts.js"></script>
<link rel="stylesheet" href="style.css">
<title>Document</title>
@NickDimmock
NickDimmock / mods-transform-code.xslt
Last active March 18, 2021 01:14
Pure > Eprints connector - custom XSLT
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:v3="http://www.loc.gov/mods/v3"
xmlns:xlin="http://www.w3.org/1999/xlink" exclude-result-prefixes="v3">
<xsl:output indent="yes" method="xml" />
<xsl:template match="text()" />
<xsl:variable name="MasterThesis">Master's Thesis</xsl:variable>
<xsl:template match="v3:mods">
@NickDimmock
NickDimmock / index.html
Last active April 14, 2019 15:59
Auto Assange
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" type="text/css" href="style.css">
<title>Auto Assange</title>
</head>
<body>
@NickDimmock
NickDimmock / index.md
Last active April 14, 2021 14:24
Mendeley guide 2021

Using Mendeley

Mendeley is a reference management tool available from https://mendeley.com.

It can help you:

  • Save and organise references to research materials
  • Highlight and annotate PDF documents
  • Sync your research library between computers
  • Back up your references and documents