Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View robertknight's full-sized avatar

Robert Knight robertknight

View GitHub Profile
This file has been truncated, but you can view the full file.
The key "target-densitydpi" is not supported.
Failed to load resource: the server responded with a status of 400 (Bad Live Resource)
Uncaught Error: invalid version specified
Skipping www.rollingstone.com not http:/
Skipping www.rollingstone.com not apis.google.com/se/0/wm/1
Failed to load resource: the server responded with a status of 401 (Unauthorized)
DOMException: Blocked a frame with origin "https://via.hypothes.is" from accessing a cross-origin frame.
at Error (native)
at init_iframe_wombat (https://via.hypothes.is/static/__pywb/wombat.js:1805:48)
at HTMLIFrameElement.getter [as contentWindow] (https://via.hypothes.is/static/__pywb/wombat.js:1351:13)
@robertknight
robertknight / mendeleydesktop
Created January 13, 2012 11:37
Mendeley Desktop launcher script with GDB
#!/usr/bin/python
import os
import subprocess
import sys
import platform
# Check if this is a 'generic Linux' build (which could be installed anywhere)
# or an Ubuntu/Debian build (installed to /usr/bin/mendeleydesktop
# with other files in /opt/mendeleydesktop)
@robertknight
robertknight / disabled-button-click-propagation.html
Created September 29, 2015 21:01
Click events in children of disabled buttons can propagate through the button in Chrome but not Firefox
<label for="enable-check">Enable button</label>
<input id="enable-check" type="checkbox">
<div id="parent">
<button id="child" disabled><div>Click me</div></button>
</div>
<script>
var enableCheckbox = document.querySelector('#enable-check');
enableCheckbox.addEventListener('click', function() {
# Search term parser from https://gist.github.com/1477730
# Modified to allow periods (and other non-letter chars) in unquoted field values
# and field names.
#
# Helper class to help parse out more advanced saerch terms
# from a form query
#
# Note: all hash keys are downcased, so ID:10 == {'id' => 10}
# you can also access all keys with methods e.g.: terms.id = terms['id'] = 10
# this doesn't work with query as thats reserved for the left-over pieces
@robertknight
robertknight / harvard-sorted.csl
Created April 24, 2012 10:25
Harvard 1 - With Alphabetically Sorted Inline Citations
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only">
<info>
<title>Sorted Harvard Reference Format</title>
<id>http://citationstyles.org/styles/harvard1-sorted</id>
<link href="http://citationstyles.org/styles/harvard1-sorted" rel="self"/>
<author>
<name>Julian Onions</name>
<email>julian.onions@gmail.com</email>
</author>
@robertknight
robertknight / gist:2918736
Created June 12, 2012 17:07
Fix for QTBUG-23205
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 030e31b..0df81a4 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5490,7 +5490,12 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
Q_Q(QWidget);
#ifndef QT_NO_GRAPHICSEFFECT
- if (graphicsEffect && graphicsEffect->isEnabled()) {
+ bool useGraphicsEffect = graphicsEffect && graphicsEffect->isEnabled();
@robertknight
robertknight / gist:3149811
Created July 20, 2012 09:19
Mac FSEvents wrapper
// MacFSEventsWatcher.h
#pragma once
#include "libMendeleyExport.h"
#include <QtCore/QObject>
#include <QtCore/QStringList>
typedef struct __FSEventStream* FSEventStreamRef;
@robertknight
robertknight / gist:4162044
Created November 28, 2012 15:39
Mendeley Mac Word Plugin Tester Script
set mendeleyAppPath to POSIX path of (path to application "Mendeley Desktop")
set wordPluginHelperPath to mendeleyAppPath & "/Contents/MacOS/MendeleyWordPlugin.app/Contents/MacOS/MendeleyWordPlugin"
log wordPluginHelperPath
run application wordPluginHelperPath
@robertknight
robertknight / weblabel.cpp
Created December 11, 2012 19:02
WebLabel src
#include "weblabel.h"
#include <QtWebKit/QWebFrame>
#include <QtWebKit/QWebSettings>
#include <QtGui/QPainter>
WebKitLabel::WebKitLabel(const QString& text, QWidget* parent)
: QFrame(parent)
, m_webPage(new QWebPage(this))
@robertknight
robertknight / mendeley-desktop-recovery.md
Last active October 15, 2015 11:35
How to downgrade from Mendeley Desktop 1.13

Switching from Mendeley Desktop 1.13 to an earlier version

Since this is a major update, it is unfortunately not backwards compatible with Mendeley Desktop 1.12. If you encounter problems with the preview release and need to go back to 1.12 whilst we fix the issue, please read this carefully.

In particular do not use the 'Restore Backup' feature for this.

Before you go back to Mendeley Desktop 1.12