Skip to content

Instantly share code, notes, and snippets.

@lancelotj
lancelotj / gist:910459
Created April 8, 2011 18:42
Create a short unique id within range of number, alphabet, - and _ from uuid
import base64, uuid
base64.b64encode(uuid.uuid4().bytes, '_-')[:22]
@lancelotj
lancelotj / simple_rest.py
Created March 23, 2012 23:31
Simple REST Framework for Django
# -*- coding: utf-8 -*-
from django.core import serializers
from django.http import HttpResponse
from django.utils import simplejson as json
from django.views.generic import View
from django.views.generic.edit import ModelFormMixin, BaseUpdateView, FormMixin, TemplateResponseMixin
class JsonResponseMixin(object):
"""
@lancelotj
lancelotj / index.js
Created April 19, 2018 18:52 — forked from just-boris/index.js
Gulp wrap pipe
/**
* Wrap gulp streams into fail-safe function for better error reporting
* Usage:
* gulp.task('less', wrapPipe(function(success, error) {
* return gulp.src('less/*.less')
* .pipe(less().on('error', error))
* .pipe(gulp.dest('app/css'));
* }));
*/