Adding JSONP to turbogears

Date

from tg import json_encode, responsefrom tg.render import _get_tg_varsdef render_jsonp(template_name, template_vars, **kwargs):callback = template_name or kwargs.pop('callback', None) or 'callback'for key in _get_tg_vars():del template_vars[key]response.headers['Content-Type'] = 'text/javascript'return '%s(%s)' % (template_name, json_encode(template_vars))from myapp.config.app_cfg import base_configbase_config.render_functions['jsonp'] = render_jsonpbase_config.mimetype_lookup ...

more ...

Move over bash: Python is my language for setup scripts now.

I know when people discuss using programming languages, there's two main schools of thought:

  • Use the same language for as much of your stack as possible
  • Use the language that's most appropriate for each part of the stack as much of possible.

Clearly, there's very strong advantages ...

more ...



Slimy: another html5 slideshow

image0After seeing a coworker's presentation completely done using html5 and javascript, I really realized how much of a platform that html5 can be. Effectively, it's a ubiquitous platform by which any operating system can run code, with very little prior setup necessary. I really liked the concept of ...

more ...

Passing perforce batch files

Date

My coworker showed this to me today: if you want to use a perforce command from the command line, and pass it a batch of filenames from a command (such as find or grep), simply use:

p4 COMMAND ${ENTER_COMMAND_HERE}

more ...


Python Pet Peeves

Date

As of this posting, Python has been my main programming language for over three years. Although I definitely feel that Python is not a good fit for all programming projects, the speed and efficiency with which I can code in it has made it my go-to language whenever possible.

As ...

more ...

Search and replace multi-line expressions with SED

Date Tags sed / unix

Now here's an interesting problem:

I wanted to do a recursive search and replace in unix, AND I wanted to do an expression that spans multiple lines. Here's what I came up with:

find ./ -type f | xargs sed -E -i -n'1h;1!H;${;g;s/<\/fileSet>.*<fileSet ...

more ...

WebPageTest and IE9

Date

Recently, I tried updating the browser for a WebPageTest instance to IE9. This proved to have some issues, specifically due to the pop-up dialogues that IE9 has now to tell you when something suspicious occurs.

Logging into WPT, I was greeted with an error on an IE9 browser opened by ...

more ...

About Yusuke Tsutsumi
I work at Zillow. I focus on tools and services for developer productivity, including build and testing.

My other interests include programming language design, game development, and learning languages (the non-programming ones).