Skip to content

Instantly share code, notes, and snippets.

View davemo's full-sized avatar
😀

David Mosher davemo

😀
View GitHub Profile
function playNotification() {
$('#notification').playNotification();
}
// becomes
function playNotification() {
$(function() {
$("#notification").playNotification();
});
#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 :)
=horizontal-form(!width)
width = !width
input
float: left
&[type="text"],&[type="select"]
width: 70%
&[type="submit"]
float: right
label
+clearfix
package
{
import com.yahoo.yui.YUIAdapter;
import flash.display.Loader;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
<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}"/>
@davemo
davemo / gist:317198
Created February 28, 2010 04:29 — forked from cmelbye/gist:317193
$('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);
}
@davemo
davemo / gist:317199
Created February 28, 2010 04:29 — forked from cmelbye/gist:317193
$('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);
}
@davemo
davemo / gist:317201
Created February 28, 2010 04:29 — forked from cmelbye/gist:317193
$('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);
}
$("#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) {
// 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