Skip to content

Instantly share code, notes, and snippets.

@uranusjr
uranusjr / configure.diff
Created February 13, 2014 08:27
Patch to remove hard-coded OS X build spec inside the configure script. Homebrew's Qt uses either unsupported-macx-clang-libc++ (Mavericks) or unsupported-macx-clang (10.8 and earlier). Both are find as default, while macx-g++ is not.
diff --git a/configure b/configure
index a1e1f5e..9d5d6e0 100755
--- a/configure
+++ b/configure
@@ -12,7 +12,6 @@ QXT_MODULES="docs berkeley core designer gui network sql web zeroconf"
if uname -a | grep -iq Darwin; then
QXT_MAC=1
DEFAULT_LIBS="/Library/Frameworks"
- QMAKE_PARAMS="-spec macx-g++"
NO_XRANDR=1
#!/usr/bin/env python
# -*- coding: utf-8
import os
from threading import Timer
last_file = None

The Legend of Tsuyoshi Shinjo

  • Tsuyoshi Shinjo (SHINJO)

    • Affliated High School of Hishi-Nippon Junior College
    • Hanshin Tigers
    • Mets
    • Giants
import sys
from PySide.QtCore import *
from PySide.QtGui import *
class KeyListener(QObject):
def eventFilter(self, obj, event):
if event.type() == QEvent.KeyPress:
if event.key() == Qt.Key_Control:
print('Control pressed')
@uranusjr
uranusjr / qxtglobalshortcut_mac.cpp.diff
Last active December 19, 2015 21:18
Patch to apply commit bf1b377 (old hg rev) to qxtglobalshortcut_mac.cpp for libqxt 0.6.2, fixing #50 (http://dev.libqxt.org/libqxt-old-hg/issue/50/). Generated with hg diff src/gui/qxtglobalshortcut_mac.cpp -r 3d7b209:bf1b377
diff -r 3d7b209ee18c -r bf1b3772b917 src/gui/qxtglobalshortcut_mac.cpp
--- a/src/gui/qxtglobalshortcut_mac.cpp Mon May 10 22:40:42 2010 +0300
+++ b/src/gui/qxtglobalshortcut_mac.cpp Wed Nov 17 17:28:04 2010 +0200
@@ -69,63 +69,118 @@
{
UTF16Char ch;
// Constants found in NSEvent.h from AppKit.framework
- if (key == Qt::Key_Up) ch = 0xF700;
- else if (key == Qt::Key_Down) ch = 0xF701;
- else if (key == Qt::Key_Left) ch = 0xF702;
{
"default": "61.221.43.43",
"databases": {
"61.221.43.43": {
"driver": "QMYSQL",
"address": "61.221.43.43",
"username": "__USERNAME_HERE__",
"password": "__PASSWORD_HERE__"
},
"192.168.1.121": {
{% comment %}
templates/base.html
{% endcomment %}
{% load menu_tags %}
{% main_menu %} {# This line renders the menu #}
{% with path=request.path %}
<li{% ifequal path '/' %} class="current"{% endifequal %}><a href="/">Home</a></li>
<li{% ifequal path '/about/' %} class="current"{% endifequal %}><a href="/about/">About</a></li>
{% endwith %}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import HTMLParser
OUTPUT_PATH = None
URL = None
# Set URL here
@uranusjr
uranusjr / injection.py
Last active December 17, 2015 08:08
A tag that injects any output of another template tag into current context. Syntax: `{% inject as variable_name from tag_name [tag_arg ...] %}` where `variable_name` if the key to inject into, `tag_name` is the name of tag to retrieve value from, and `tag_arg`s are parameters to be used in the tag specified by `tag_name`.
from django.template import (
TemplateSyntaxError, Library, Node, Variable, Token, TOKEN_BLOCK
)
register = Library()
@register.tag(name='inject')
def inject(parser, token):