This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django import forms | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field | |
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions | |
class MessageForm(forms.Form): | |
text_input = forms.CharField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def incremental_map_reduce( | |
map_f, | |
reduce_f, | |
db, | |
source_table_name, | |
target_table_name, | |
source_queued_date_field_name, | |
counter_table_name = "IncrementalMRCounters", | |
counter_key = None, | |
max_datetime = None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.factory('TokenHandler', function() { | |
var tokenHandler = {}; | |
var token = "none"; | |
tokenHandler.set = function( newToken ) { | |
token = newToken; | |
}; | |
tokenHandler.get = function() { | |
return token; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COFFEEC = coffee | |
SASSC = sass | |
HANDLEBARSC = handlebars | |
# Build app package | |
APPSRC = static/scripts/main.coffee | |
APPOBJ = ${APPSRC:.coffee=.js} | |
APPOUT = static/scripts/app.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoengine | |
class MongoModelSerializer(serializers.ModelSerializer): | |
def get_default_fields(self): | |
cls = self.opts.model | |
opts = get_concrete_model(cls) | |
#pk_field = opts.pk | |
fields = [] | |
fields += [getattr(opts, field) for field in opts._fields] | |
#fields += [field for field in opts.many_to_many if field.serialize] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Author: Niclas Hoyer <[email protected]> | |
Copyright (C) 2012 Niclas Hoyer <[email protected]> | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Library General Public | |
License as published by the Free Software Foundation; either | |
version 2 of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.test import client | |
# Call this function on head of your test file. | |
def patch_request_factory(): | |
def _method(self, path, data='', content_type='application/octet-stream', follow=False, **extra): | |
response = self.generic("PATCH", path, data, content_type, **extra) | |
if follow: | |
response = self._handle_redirects(response, **extra) | |
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A Boilerplate Grunt ~0.4.0 build system for AngularJS projects | |
* | |
* Licensed MIT | |
*/ | |
module.exports = function ( grunt ) { | |
// Load required Grunt tasks | |
grunt.loadNpmTasks('grunt-recess'); | |
grunt.loadNpmTasks('grunt-contrib-clean'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "keys": ["ctrl+œ"], "command": "show_panel", "args": {"panel": "console", "toggle": true} }, | |
{ | |
"keys": ["super+alt+&"], | |
"command": "set_layout", | |
"args": | |
{ | |
"cols": [0.0, 1.0], | |
"rows": [0.0, 1.0], | |
"cells": [[0, 0, 1, 1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Change YOUR_TOKEN to your prerender token | |
# Change example.com (server_name) to your website url | |
# Change /path/to/your/root to the correct value | |
server { | |
listen 80; | |
server_name example.com; | |
root /path/to/your/root; | |
index index.html; |
OlderNewer