Skip to content

Instantly share code, notes, and snippets.

# based on http://stanislav.it/how-to-prevent-ios-standalone-mode-web-apps-from-opening-links-in-safari/
if window.navigator.standalone?
noddy = false
remotes = false
document.addEventListener 'click', (event) ->
noddy = event.target
from django.core.urlresolvers import reverse_lazy
from django.views.generic import CreateView
from app.forms import MyModelForm
from app.lib.api import API
class MyCreateView(CreateView):
template_name = 'form.html'
form_class = MyModelForm
from django.views.generic import TemplateView
if settings.DEBUG:
# enable local preview of error pages
urlpatterns += patterns('',
(r'^403/$', TemplateView.as_view(template_name="403.html")),
(r'^404/$', TemplateView.as_view(template_name="404.html")),
(r'^500/$', TemplateView.as_view(template_name="500.html")),
raise ffiplatform.VerificationError(error)
cffi.ffiplatform.VerificationError: importing '/private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so': dlopen(/private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so, 2): Symbol not found: _CRYPTO_malloc_debug_init
Referenced from: /private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so
Expected in: flat namespace
in /private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so
# install via MacPorts
sudo port install openssl
sudo env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install cryptography
# install via Homebrew
brew install openssl
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography
*.html
Gruntfile.coffee
package.json
/lib
/coffee
*.coffee
/css
*.css
/js
*.js
# install sass
sudo gem install sass
# install grunt cli globally
sudo npm install -g grunt-cli
# note - switch to project directory where Gruntfile.coffee and package.json are sitting
# install dependencies
npm install
{
"name": "grunt-sass-coffeescript",
"version": "0.1.0",
"repository": "",
"devDependencies": {
"grunt": "~0.4.2",
"grunt-contrib-sass": "~0.7.2",
"grunt-contrib-coffee": "~0.10.1",
"grunt-contrib-watch": "~0.5.3",
"coffee-script": "~1.7.1"
module.exports = (grunt) ->
# configuration
grunt.initConfig
# grunt sass
sass:
compile:
options:
style: 'expanded'
# myapp/signals/handlers.py
from django.dispatch import receiver
from .signals import example_signal
@receiver(example_signal)
def example_signal_handler(sender, **kwargs):
print kwargs['arg1']
print kwargs['arg2']