Skip to content

Instantly share code, notes, and snippets.

@yuchant
yuchant / jquery.crossfade.js
Created February 11, 2012 05:51
jQuery cross fade..
/*
Cross Fade Any Element
Version 0.01
By Yuji Tomita
February 10, 2012.
*/
(function( $ ){
$.fn.crossFadeTo = function( fadeToElement, speed, options) {
@yuchant
yuchant / has_exact_m2m_match.py
Created February 24, 2011 23:21
Find an exact object-m2m match in Python -- no SQL.
"""
Find Exact M2M - Match
=========
Find an exact m2m match for a model.
Just did for fun in response to a stackoverflow question for a data importing issue....
By Yuji Tomita
2/24/2011
@yuchant
yuchant / bad_idea.py
Created February 23, 2011 04:07
A Terrible Idea
class ModelAdmin(admin.ModelAdmin)
"""
Refrain from prolonged exposure.
"""
def render_change_form(self, request, context, *args, **kwargs):
def get_queryset(original_func):
import inspect, itertools
def wrapped_func():
if inspect.stack()[1][3] == '__iter__':
return itertools.repeat(None)