Skip to content

Instantly share code, notes, and snippets.

View gist:265147
function playNotification() {
$('#notification').playNotification();
}
// becomes
function playNotification() {
$(function() {
$("#notification").playNotification();
});
View gist:265433
#wrap
+container // using blueprint it gives
#content
+column(16) // 16 grid units wide column
#sidebar
+column(8, true) // 8 units wide, true because it's the last column
// You can write the SASS and the HTML in the same way, using Compass and the Zen-Coding bundle. Prototyping layouts is super quick :)
View gist:266359
=horizontal-form(!width)
width = !width
input
float: left
&[type="text"],&[type="select"]
width: 70%
&[type="submit"]
float: right
label
+clearfix
View Uploader.as
package
{
import com.yahoo.yui.YUIAdapter;
import flash.display.Loader;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
View gist:280368
<target name="coverage" depends="clean, copy-coverage-so, copy-index-yaml-static">
<tempfile property="coverage.outfile" destDir="/tmp" />
<!-- Temporarily turns off the USE_I18N in settings.py, re-enabled when coverage has completed -->
<replace file="${srcdir}/settings.py" token="USE_I18N = False" value="USE_I18N = True" />
<!-- see comments in "test" target -->
<exec dir="${srcdir}" executable="python" failonerror="false" resultproperty="coverage.retcode" output="${coverage.outfile}" logError="true">
<env key="UNITTESTS" value="${tests}" />
<env key="PYTHONPATH" value="${test.pythonpath}"/>
View gist:317198
$('form.section_edit_form').live('submit', function () {
var section_id = $(this).parent().attr('id').split("_")[1];
$.ajax({
url: "/wiki/ajax/section_edit/?section_id=" + section_id,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$(this).parent().html(data);
}
View gist:317199
$('form.section_edit_form').live('submit', function () {
var section_id = $(this).parent().attr('id').split("_")[1];
$.ajax({
url: "/wiki/ajax/section_edit/?section_id=" + section_id,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$(this).parent().html(data);
}
View gist:317201
$('form.section_edit_form').live('submit', function () {
var section_id = $(this).parent().attr('id').split("_")[1];
$.ajax({
url: "/wiki/ajax/section_edit/?section_id=" + section_id,
type: "POST",
data: $(this).serialize(),
success: function(data) {
$(this).parent().html(data);
}
View gist:325612
$("#id_logo").uploadify({
'uploader' : '{% vurl "/static/script/vendor/uploadify/uploadify.swf" %}',
'script' : '{% url business-listing-logo company.key %}',
'cancelImg' : '{% vurl "/static/script/vendor/uploadify/cancel.png" %}',
'scriptAccess' : 'always',
'auto' : true,
'queueID' : 'fileQueue',
'fileDataName' : 'logo',
'sizeLimit' : 1000000, // ah, the old 1mb limit rears its head :(
onComplete : function(evt, queueID, file, response) {
View gist:325774
// DEFAULT 2.1.0 Code
if(jQuery)(
function(jQuery){
jQuery.extend(jQuery.fn,{
uploadify:function(options) {
jQuery(this).each(function(){
// BAD GLOBAL, BAD, yields "Object does not support this property or method" in IE7/8
settings = jQuery.extend({
// FIXED 2.1.0 Code
You can’t perform that action at this time.