Skip to content

Instantly share code, notes, and snippets.

import QtQuick 2.0
import Ubuntu.Components 0.1
MainView {
// objectName for functional testing purposes (autopilot-qt5)
objectName: "mainView"
// Note! applicationName needs to match the "name" field of the click manifest
applicationName: "com.ubuntu.developer.username.panel-test"
@rschroll
rschroll / oxide-test.html
Created July 10, 2014 18:30
Communicating with an Oxide WebView
<html>
<head>
<script>
document.addEventListener("QMLmessage", function (event) {
document.body.innerHTML += "<p>Message received. You said " + event.detail.greeting + "</p>";
});
</script>
</head>
<body>
@rschroll
rschroll / dialog-test.qml
Created July 3, 2014 16:16
Demonstrating problems with Dialog sizing in the Ubuntu toolkit
/* Copyright 2013 Robert Schroll
*
* This file is part of Beru and is distributed under the terms of
* the GPL. See the file COPYING for full details.
*/
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1
import Ubuntu.Components.Popups 0.1
@rschroll
rschroll / applist.py
Last active August 29, 2015 13:56
A script to browse the Ubuntu Touch apps
#!/usr/bin/env python
# A basic Python script to let you browse the apps available in the
# Ubuntu Touch App store. Run it and your web browser should open.
#
# Copyright 2014 Robert Schroll
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
@rschroll
rschroll / flickable.qml
Last active December 22, 2015 15:19
A test case demonstrating problems with setting flickable = null in the Ubuntu SDK. (Now fixed!)
import QtQuick 2.0
import Ubuntu.Components 0.1
import Ubuntu.Components.ListItems 0.1
MainView {
width: units.gu(50)
height: units.gu(75)
Page {
id: page
@rschroll
rschroll / resympy.py
Created August 17, 2012 03:34
Sympy wrapper for Reinteract
# Copyright 2009, 2010, 2012 Jorn Baayen
# Copyright 2012 Robert Schroll
#
# Released under the BSD license.
#
# Based on code proposed for inclusion with Reinteract. This version uses
# matplotlib's TexManager to display the LaTeX instead of Lasem, but works
# similarly otherwise.
import gtk
@rschroll
rschroll / highlightedtext.py
Created June 16, 2012 23:05
Decoding #pdfloc for highlighted text in the Sony PRS-T1
#!/usr/bin/env python
"""
%s mount-point
Print to a file information on the highlighted text of a selected file on
the reader at mount-point. The output file is tab-separated data of the
form:
page highlight-range mark-start mark-end mark-type marked-text
mark-start and mark-end are the 'pdfloc' data defining where the marked
@rschroll
rschroll / gist:2221668
Created March 28, 2012 00:06
Delayed resize of sidebar widgets in Reinteract
import gobject as _gobject
class _ResizeBox(_gtk.VBox):
def __init__(self, figure):
_gtk.VBox.__init__(self)
self.figure = figure
# Rounding errors slowly accumlate in the figure height, shrinking it down
# over time. So we make a copy here and use that to keep resetting the
# canvas to the proper size.