Skip to content

Instantly share code, notes, and snippets.

View freakboy3742's full-sized avatar

Russell Keith-Magee freakboy3742

View GitHub Profile
@freakboy3742
freakboy3742 / app.py
Created April 25, 2017 05:22
Password example
import toga
class Login(toga.App):
def validate_user(self, widget):
if self.username.value == self.password.value:
self.main_window.info_dialog("Login", "Welcome to the show!")
else:
self.main_window.error_dialog("Error", "Go away, intruder!")

Cross-platform Native GUI development with BeeWare

Description

Both your title and this description are made public and displayed in the conference program to help attendees decide whether they are interested in this presentation. Limit this description to a few concise paragraphs.

Have you ever wanted to write a GUI application you can run on your laptop? What about an app that you can run on your phone? Historically, these have been difficult to achieve with Python, and impossible to achieve without learning a different API for each platform. But no more.

@freakboy3742
freakboy3742 / challenge.rst
Last active April 13, 2017 22:11
The challenge

The Challenge

Abstract

Develop a Visual Studio 2017 solution file that will enable a user to download a zip file of content (including a solution file), open the solution, hit run, and have the code Just Work (tm).

Full description

@freakboy3742
freakboy3742 / idea.md
Last active March 26, 2017 23:57
Random business idea for the morning

Random business idea: Security notifications as-a-Service

Software authors sign up, get a bug tracker-like interface, but focussed at identifying the severity and impact of issues that have been reported. Issues are closed when a patch is uploaded.

Software users sign up to be put on a notification list when software they use announces a vulnerability. Emails sent to users are formatted to provide best practice reporting - easily identifiable severity and impact.

Software authors get a public interface for receiving security issues. The user reporting the problem gets notified when the bug is triaged, announced, and so on.

The service assists in the process of getting CVEs for projects.

ol > li::before {
content: counter(list-item) ". ";
width: 0.8em;
display: inline-block;
}
ol > li {
text-indent: -0.8em;
}
@freakboy3742
freakboy3742 / WTF.md
Last active March 13, 2017 07:35
What the hell is `mobility`?

Create virtual environment

hammer:briefcase rkm$ mkvirtualenv --python=`which python3.5` briefcase3.5
Running virtualenv with interpreter /usr/local/bin/python3.5
Using base prefix '/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5'
New python executable in /Users/rkm/.virtualenvs/briefcase3.5/bin/python3.5
Also creating executable in /Users/rkm/.virtualenvs/briefcase3.5/bin/python
Installing setuptools, pip, wheel...done.
Collecting ipython

Using cached ipython-5.3.0-py3-none-any.whl

@freakboy3742
freakboy3742 / things.md
Last active March 17, 2017 22:53
Things you could do

Here’s a couple of suggestions for ways you can contribute, based on what you’ve said about your experience:

  1. Don’t worry about your lack of Java experience, and just have a go! I know it may seem weird to be writing Java to help a Python project, but the Java experience you require to make the contributions on isn’t that advanced - in most cases, there will be similar code nearby that you can use as a starting point. Plus, learning more than one programming language is good for your brain - you start to see how other languages solve the same problems.

  2. A relatively simple task that requires Python skills is to audit all the Python data types (list, tuple, string, and so on), and flesh out the tests and definitions for the methods on those types. For example, you can call “my_string.upper()” to convert a string to upper case - is that method implemented in Java? If not, put an empty stub function in the java file (or even just a comment that says “definition of upper() goes here”. Do a full audit of a

@freakboy3742
freakboy3742 / quandry.rst
Last active November 28, 2016 05:23
Should I propose a PyCon US Tutorial?

The deadline for PyCon US tutorial proposals is rapidly approaching, and I have a quandry: Should I propose a BeeWare tutorial for PyCon US 2017?

My concern is that there isn't enough working material in the BeeWare suite to warrant a tutorial.

There’s enough working to demonstrate a relatively simple, very specific app running in macOS, iOS, and GTK+. But outside of that specific demonstrator, widget support is spotty, there's no Windows support at all, Android support is limited to using a subset of Python and very little of the standard library, and Web support is extremely primitive. So I don't feel like I can, in good conscience, advertise this as a "come and learn how to make a cross-platform app with Toga".

Instead, a tutorial would need to be an intermediate to advanced level long-form demonstration of the capabilities of Toga, Rubicon, VOC, Batavia etc. We could dig into the specifics of how each bridge works, which would be an interesting exploration of the internals of Python and some little-u

@freakboy3742
freakboy3742 / example.py
Created November 22, 2016 10:52
Toga for Django
import toga
def button_handler(widget):
print("Hello")
class Example(toga.App):
def startup(self):
@freakboy3742
freakboy3742 / Stack trace
Created August 18, 2016 14:04
VerifyError?
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 53
Exception Details:
Location:
python/example/__init__.main([Ljava/lang/String;)V @2: getstatic
Reason:
Expected stackmap frame at this location.
Bytecode:
0000000: 014c b200 2059 bb00 2659 1300 28b7 002a
0000010: bb00 0159 59b7 005f 4cb9 0060 0300 bb00
0000020: 2659 1300 64b7 002a 2bb9 0060 0300 2bb6