DO's:
- Use explicit contracts to pipe data & events between systems
- Business rules should bubble towards the top, UI and semantics should sink towards the bottom
DONT's:
from boto.s3.cors import CORSConfiguration | |
from boto.s3.connection import S3Connection | |
conn = S3Connection('<aws access key>', '<aws secret key>') | |
bucket = conn.create_bucket('mybucket') | |
config = CORSConfiguration() | |
config.add_rule(allowed_method=['GET'], allowed_origin=['*'], allowed_header=['Content-*', 'Host'], max_age_seconds=3000) | |
bucket.set_cors(config) |
from gevent import monkey; monkey.patch_all() | |
from gevent.pool import Pool | |
import stripe | |
to_delete = list() | |
pool = Pool(10) | |
def check_customer(customer): | |
if customer['subscription'] or customer['default_card']: | |
return False |
import io | |
numbers = { | |
(' _ ', '| |', '|_|'): 0, | |
(' ', ' |', ' |'): 1, | |
(' _ ', ' _|', '|_ '): 2, | |
(' _ ', ' _|', ' _|'): 3, | |
(' ', '|_|', ' |'): 4, | |
(' _ ', '|_ ', ' _|'): 5, |
from rethinkdb.net import ConnectionInstance, SocketWrapper, Connection, decodeUTF | |
from rethinkdb.errors import * | |
import socket | |
import time | |
import ssl | |
class TLSConnectionInstance(ConnectionInstance): | |
def connect(self, timeout): | |
self._socket = TLSSocketWrapper(self, timeout) |
import React, { PropTypes } from "react"; | |
import { isMultiSelect, retrieveSchema } from "zbyte64/react-jsonschema-form/src/utils"; | |
import ArrayField from "zbyte64/react-jsonschema-form/src/components/fields/ArrayField"; | |
import BooleanField from "zbyte64/react-jsonschema-form/src/components/fields/BooleanField"; | |
import NumberField from "zbyte64/react-jsonschema-form/src/components/fields/NumberField"; | |
import ObjectField from "zbyte64/react-jsonschema-form/src/components/fields/ObjectField"; | |
import StringField from "zbyte64/react-jsonschema-form/src/components/fields/StringField"; | |
import UnsupportedField from "zbyte64/react-jsonschema-form/src/components/fields/UnsupportedField"; |
(defn show-form [data _] | |
(om/component | |
(let [schema (:current-form data) | |
alpaca-html (.html (.alpaca (js/jQuery. "<div/>") (clj->js {:schema schema}))) | |
form-html (js/React.DOM.div (clj->js {:dangerouslySetInnerHTML {:__html alpaca-html}}))] | |
form-html))) |
var _ = require('lodash'); | |
function isComponent(obj) { | |
//ghetto check because JS | |
return (obj && obj.setState) | |
} | |
function deepCloneComponent(tpl) { | |
if (!tpl) return; | |
if (_.isArray(tpl)) { |
from django.contrib import admin | |
from .models import Blog | |
from .fields import UserSelectWidget | |
class BlogForm(forms.ModelForm): | |
class Meta: | |
model = Blog | |
exclude = [] |
#inside the Build directory of the source code: | |
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Release -DWITH_SSE=OFF -DWITH_CRASH_HANDLER=OFF -DWITH_MINIMAID=OFF .. | |
cmake .. | |
make -j2 |