Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| class YourResource(ModelResource): | |
| def wrap_view(self, view): | |
| """ | |
| Wraps views to return custom error codes instead of generic 500's | |
| """ | |
| @csrf_exempt | |
| def wrapper(request, *args, **kwargs): | |
| try: |
#Stay Standalone
A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.
| function add_inline_form(prefix) { | |
| var count = parseInt($('#id_' + prefix + '-TOTAL_FORMS').val(), 10); | |
| var last_form = $('.' + prefix + ':last'); | |
| var new_form = last_form.clone(false).html(last_form.html().replace( | |
| new RegExp(prefix + '-\\\\d-', 'g'), prefix + '-' + count + '-')); | |
| new_form.find('input[type="text"], textarea').each(function () { | |
| $(this).val(''); | |
| }); | |
| new_form.hide().insertAfter(last_form).slideDown(300); |
| <?php | |
| /** | |
| * Split a array into semi-equal sized chunks. | |
| * A so-called 'columnizer' | |
| * | |
| * @param array $array The array to split | |
| * @param array $numberOfChunks The number of chunks | |
| * @param bool $vertical Whether to order vertically or horizonally | |
| * | |
| * @return array Array with $numberOfColumns nodes with items of $array |
| #!/usr/bin/env python | |
| """ | |
| Use pip to get a list of local packages to check against one or more package | |
| indexes for updated versions. | |
| """ | |
| import pip | |
| import sys, xmlrpclib | |
| from cStringIO import StringIO | |
| from distutils.version import StrictVersion, LooseVersion |
| h scroll left | |
| j scroll down | |
| k scroll up | |
| l scroll right | |
| gg scroll to top of the page | |
| G scroll to bottom of the page | |
| f activate link hints mode to open in current tab | |
| F activate link hints mode to open in new tab | |
| r reload |