Skip to content

Instantly share code, notes, and snippets.

module TypographyHelper
WIDOW_EXPRESSION = /([^\s])\s+([^\s]+)\s*$/
def widont(text, count=1)
count.times.inject(text) do |text|
text.sub(WIDOW_EXPRESSION, '\1 \2')
end
end
end
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)
#!/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