Skip to content

Instantly share code, notes, and snippets.

if (document.body.style[ '-webkit-mask-repeat' ] !== undefined)
$('html').addClass('cssmask');
class ProjectMixin(object):
project_url_pk = 'project_id'
project = None
def dispatch(self, request, *args, **kwargs):
self.project = get_object_or_404(Project, pk=kwargs.get(self.project_url_pk))
return super(ProjectMixin, self).dispatch(request, *args, **kwargs)
def get_context_data(self, **kwargs):
context = super(ProjectMixin, self).get_context_data(**kwargs)
@amccloud
amccloud / Growl.applescript
Created September 26, 2011 10:44
Lion iChat Growl Notifications
using terms from application "iChat"
on message received message from theBuddy for textChat
set whoDidIt to full name of theBuddy
set buddyIcon to image of theBuddy
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
end tell
tell application frontApp
set window_name to name of front window
end tell
#!/usr/bin/python2.4
#
# Copyright 2009 Empeeric LTD. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
/*
* Photoshop.h
*/
#import <AppKit/AppKit.h>
#import <ScriptingBridge/ScriptingBridge.h>
@class PhotoshopApplication, PhotoshopDocument, PhotoshopBatchOptions, PhotoshopChangeModeOptions, PhotoshopBitmapModeOptions, PhotoshopChannel, PhotoshopColorSampler, PhotoshopContactSheetOptions, PhotoshopCountItem, PhotoshopFont, PhotoshopGalleryBannerOptions, PhotoshopGalleryColorOptions, PhotoshopGalleryImagesOptions, PhotoshopGalleryOptions, PhotoshopGallerySecurityOptions, PhotoshopGalleryThumbnailOptions, PhotoshopHistoryState, PhotoshopIndexedModeOptions, PhotoshopInfoObject, PhotoshopLayer, PhotoshopArtLayer, PhotoshopLayerComp, PhotoshopLayerSet, PhotoshopMeasurementScale, PhotoshopPicturePackageOptions, PhotoshopPresentationOptions, PhotoshopSelectionObject, PhotoshopSettingsObject, PhotoshopTextObject, PhotoshopXMPMetadata, PhotoshopOpenOptions, PhotoshopCameraRAWOpenOptions, PhotoshopDICOMOpenOptions, PhotoshopEPSOpenOptions, PhotoshopPDFOpenOptions, PhotoshopPhotoCDOpenOptions, PhotoshopRawFormatOpenO
from django.contrib.auth.models import User as AuthUser
from django.db.models.signals import post_save, post_delete
class BaseUser(AuthUser):
class Meta:
abstract = True
@classmethod
def __sync__(cls, from_user, to_user):
if not from_user.pk and to_user.pk:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Error evaluating module "undefined" at location "undefined":
Error: ENOENT, no such file or directory '/Users/andrew/.virtualenvs/.../public/static/dashboard/js/templates/base.html.js'
fileName:undefined
lineNumber: undefined
http://requirejs.org/docs/errors.html#defineerror
at makeError (/usr/local/lib/node_modules/requirejs/bin/r.js:179:17)
at execManager (/usr/local/lib/node_modules/requirejs/bin/r.js:595:23)
({
baseUrl: 'public/static',
paths: {
jquery: 'vendor/js/jquery/dist/jquery',
underscore: 'vendor/js/underscore/underscore',
backbone: 'vendor/js/backbone/backbone',
dashboard: 'dashboard/js',
text: 'vendor/js/requirejs/text'
},
modules: [
from django.db import models
optional = dict(blank=True, null=True)
class Foo(models.Model):
bar = models.CharField()
baz = models.CharField(**optional)
#!/bin/bash
for file in $1/*.mp3
do
mp3splt -d previews -f 1.00 1.29 "$file"
done