[three]Bean

(most) all tw2 widgets have samples!

Apr 28, 2011 | categories: python, toscawidgets View Comments

I just got two requests for a tutorial on tw2.jqplugins.jqgrid.SQLAjqGridWidget which interrogates whatever sqlalchemy model you give it and produces a nifty jqgrid web widget (python, WSGI, of course!)

Before I release a tutorial, I thought I'd point out that (most) all tw2 widgets have a tw2..samples module which:

  • 1) Gets picked up and rendered by the tw2.devtools widget browser (which is running live here).
  • 2) Can educate you on how to use the widgets in which you are particularly interested.

For the SQLAjqGridWidget, you can find that code right here on my github account.

Tutorial coming soon!

View Comments

jquery-ui portlets with saved position and state via cookies

Apr 25, 2011 | categories: python, toscawidgets, javascript View Comments

Back in June of 2010, I was wondering how to save the order/arrangement of jquery-ui portlets and their open/closed state to a cookie. After much searching and finding nothing, I came up with my own solution and posted it at the end of a long thread on the jquery-ui mailing list. (Since then, I found that it's been linked to from a stackoverflow answer!)

You can see a live demo of my solution here.

If you're a python web programmer, you should know that my tw2.jqplugins.portlets package uses this solution by default, encapsulating all the work for you. Here are links to everything you need to get started using that project:

View Comments

New storage closet at work

Apr 22, 2011 | categories: lulz View Comments

The work of paulmezz.

View Comments

Using fabric to manage moksha development

Apr 13, 2011 | categories: python, fabric, moksha View Comments

Now I know that fabric is really meant for managing deployment, but to try and teach myself what it can do, I rewrote some monster bash-scripts that manage the development environment for Luke Macken's awesome project moksha.

I came up with:

  • A master fabfile to manage moksha-proper development.
  • A template fabfile that gets placed in the base directory of new apps created from moksha's paster templates.

Here's an example of how to use them to start up a new moksha app.
#!/bin/bash

rm -rf threebean
mkdir -p threebean
pushd threebean

git clone git://github.com/ralphbean/moksha.git
pushd moksha
fab -H localhost bootstrap
popd

# If you don't already have it sourced in your .bashrc!
source /usr/bin/virtualenvwrapper.sh

workon moksha
paster moksha -l -c -u -C -P << EOF
testapp
moksha.test
EOF
deactivate

pushd testapp
fab -H localhost install
popd


pushd moksha
fab -H localhost develop
fab -H localhost start
popd

popd

# You should see the testapp widget show up under the 'widgets' menu.
firefox http://localhost:8080/ &amp;
View Comments

fpaste to and from clipboard by hotkey in xmonad

Apr 07, 2011 | categories: gtd View Comments

I find that in irc, I'm often selecting some code from vim or some shell output with my mouse, jumping to a browser, loading fpaste.org, pasting the content, clicking submit, selecting the link/copying it, switching back to IRC and finally pasting the link.

Jeez. That's mouse->keyboard->keyboard->mouse->mouse->mouse->keyboard->mouse.

If you have the fpaste cli tool installed (on Fedora) you can do what I did and bind a handy keystroke right next to your bitlyclip binding in your ~/.xmonad/xmonad.hs (or whatever window manager config of your choice).

    ,("C-b", spawn "/usr/bin/bitlyclip")
    ,("C-M-z", spawn "notify-send 'fpasteclip' $(fpaste -i -o)")
    ,("C-M-a", spawn "notify-send 'fpasteclip with python syntax highlighting' $(fpaste -l python -i -o)")

Now with ctrl+alt+z, whatever was in your clipboard has been dumped into fpaste and your clipboard now contains the needed link in one go!

View Comments

« Previous Page -- Next Page »