Skip to content

Instantly share code, notes, and snippets.

View plasticine's full-sized avatar
🐧
Hello? Is this thing on?

Justin Morris plasticine

🐧
Hello? Is this thing on?
View GitHub Profile
from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
@user_passes_test(lambda u: u.has_perm('foo.bar'), login_url=settings.LOGIN_URL)
def widgetize(request):
""" Clever, clever, clever... """
pass
@plasticine
plasticine / gist:44151
Created January 7, 2009 02:42
jQuery Fairydust to help style form inputs...
$(document).ready(function() {
$('input:file').each(function(index) {
$(this).wrap('<label class="file-input"></label>').wrap('<div class="file-wrapper" style="position:relative;"></div>');
$('.file-wrapper').prepend('<span class="file-input-title">Upload file</span>').append('<span class="file-input-path">...</span>');
$(this).css({'opacity':'0.0', 'position':'absolute', 'top':'0', 'left':'0'});
$(this).change(function(){
var value = $(this).val();
$(document).ready(function() {
jQuery.fn.commentform = function(){
return this.each(function(){
$("#slider").slideToggle("slow").toggleClass('open');
$(this).toggleClass("active");
if($(this).attr('id')){
var replyData = /reply-([\d]{1,})-([\w]{1,})/.exec($(this).attr('id'));
var userSelection = getSelectedText();
if(userSelection){
ServerPath /repo/
RewriteEngine On
RewriteRule ^(/repo/.*) /path/$1
// Tumblr bookmarklet script
javascript:
var%20d = document,
w = window,
e = w.getSelection,
k = d.getSelection,
x = d.selection,
s = (e?e():(k)?k():(x?x.createRange().text:0)),
f = 'http://www.tumblr.com/share',