start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
# https://gist.github.com/949831 | |
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
# command line OTA distribution references and examples | |
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
# coding=utf8 | |
# Copyright (C) 2011 Saúl Ibarra Corretgé <saghul@gmail.com> | |
# | |
__all__ = ['Database', 'DatabaseError'] | |
from threading import Thread | |
from sqlobject import connectionForURI, sqlhub, SQLObject, StringCol | |
from twisted.internet import reactor | |
from twisted.internet.threads import deferToThreadPool |
This playbook has been removed as it is now very outdated. |
class ReloaderEventHandler(FileSystemEventHandler): | |
""" | |
Listen for changes to modules within the Django project | |
On change, reload the module in the Python Shell | |
Custom logic required to reload django models.py modules | |
Due to the singleton AppCache, which caches model references. | |
For those models files, we must clear and repopulate the AppCache | |
""" | |
def __init__(self, *args, **kwargs): |
from PySide import QtGui | |
class CustomSortFilterProxyModel(QtGui.QSortFilterProxyModel): | |
""" | |
Implements a QSortFilterProxyModel that allows for custom | |
filtering. Add new filter functions using addFilterFunction(). | |
New functions should accept two arguments, the column to be | |
filtered and the currently set filter string, and should | |
return True to accept the row, False otherwise. |
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |
from PySide import QtCore, QtGui | |
import sys | |
app = QtGui.QApplication(sys.argv) | |
QtGui.qApp = app | |
folderTree = QtGui.QTreeWidget() | |
header = QtGui.QTreeWidgetItem(["Virtual folder tree","Comment"]) | |
#... |
This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes
.
Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes
CFFI is nice because:
ctypes