View machine.js
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
View fabfile.py
""" | |
Usage | |
===== | |
1. Install Fabric - http://www.fabfile.org/ | |
2. Obtain db_converter.py from | |
https://github.com/lanyrd/mysql-postgresql-converter - put it in the same | |
directory as this fabfile. |
View app.py
import os | |
from flask import Flask, render_template, request | |
import stripe | |
stripe_keys = { | |
'secret_key': os.environ['SECRET_KEY'], | |
'publishable_key': os.environ['PUBLISHABLE_KEY'] | |
} | |
stripe.api_key = stripe_keys['secret_key'] |
View admin_raw_id.py
""" | |
Show customisable str representation of the linked objects next to each raw id | |
field in a django admin change form. Works for ForeignKey, OneToOneField, and | |
ManyToManyField fields. | |
Example: | |
from django.contrib import admin | |
from admin_raw_id import ImprovedRawIdFieldsAdmin | |
from .models import MyModel |
View postgres_ft.py
# -*- coding: utf-8 -*- | |
""" | |
To enable (and test) the unaccent function, as a superuser: | |
\connect DATABASE | |
CREATE EXTENSION unaccent; | |
SELECT unaccent('èéêë'); | |
Example |
View simple_search.py
# Deprecated - see https://github.com/gregplaysguitar/django-simple-search/ |
View LICENSE.txt
Copyright (c) 2015 Greg Brown | |
[gregbrown.co.nz](http://gregbrown.co.nz) | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions | |
are met: | |
1. Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
2. Redistributions in binary form must reproduce the above copyright |
View jinja_cms.py
# -*- coding: utf-8 -*- | |
from django.conf import settings | |
from coffin import template | |
from jinja2 import contextfunction, Markup | |
from cms.application import get_rendered_block, get_rendered_image | |
from cms.templatetags.cms_editor import cms_editor | |
from cms.utils import is_editing |
View xapian-virtualenv.sh
pkgver=1.2.19 | |
mkdir -p $VIRTUAL_ENV/src && cd $VIRTUAL_ENV/src | |
curl -O http://oligarchy.co.uk/xapian/$pkgver/xapian-core-$pkgver.tar.xz && tar xf xapian-core-$pkgver.tar.xz | |
curl -O http://oligarchy.co.uk/xapian/$pkgver/xapian-bindings-$pkgver.tar.xz && tar xf xapian-bindings-$pkgver.tar.xz | |
cd $VIRTUAL_ENV/src/xapian-core-$pkgver | |
./configure --prefix=$VIRTUAL_ENV && make && make install | |
export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib |
View placeholder.scss
// Placeholder @mixin for Sass | |
// | |
// A mixin to style placeholders in HTML5 form elements. | |
// Includes also a .placeholder class to be used with a polyfill e.g. | |
// https://github.com/mathiasbynens/jquery-placeholder | |
// Requires Sass 3.2. | |
// | |
// Example usage (.scss): | |
// | |
// input { |
NewerOlder