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 OpenSSL import crypto, SSL | |
from socket import gethostname | |
import socket | |
import os | |
import re | |
from pprint import pprint | |
from time import gmtime, mktime | |
from os.path import exists, join |
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
var IReact = require.bind(window.frames['layout'])('react'); | |
IReact.renderComponent(IReact.DOM.div({}, "hello world"), window.frames['layout'].document.body); |
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
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR T |
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
function siteDef(state) { | |
return <div> | |
function* () { | |
var state = "Your Site"; | |
var resolve; | |
function render() { | |
return <h1 contentEditable={true} onInput={onInput}>{state}</h1>; | |
} | |
function rerender() { |
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
/** @jsx this */ | |
//classic callback | |
function clicker(props, children, render) { | |
var clicks = 0; | |
function clicked(event) { | |
event.preventDefault(); | |
clicks += 1; | |
render(); //or render(clicks) to allow caching | |
} | |
return function() { |
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
function mergeElements(target, source) { | |
var seen = {}; | |
if (target.tagName != source.tagName) { | |
console.log("tagname change:", target.tagName, source.tagName, source) | |
target.parentNode.replaceChild(source, target); | |
return; | |
} | |
_.each(source.attributes, function(att) { | |
seen[att.nodeName] = true; | |
if (att.nodeName === 'data-reactid') { |
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
<Route path="/" component={AdminPanel}> | |
<Route path="users" component={CrudList}> | |
<Route path="/add" component={CrudAdd}/> | |
<Route path="/:id" component={CrudDetail}/> | |
<Route path="/:id/delete" component={CrudDelete}/> | |
<Route path="/:id/transfer" component={TransferAccount}/> | |
</Route> | |
<Route path="industries" component={CrudList}> |
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.views.debug import technical_500_response | |
import sys | |
import webbrowser | |
import tempfile | |
class BrowserExceptionMiddleware(object): | |
def process_exception(self, request, exception): | |
response = technical_500_response(request, *sys.exc_info()) | |
path = tempfile.mkstemp(suffix='html')[1] | |
open(path, 'w').write(response.content) |
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
/* | |
Registers the following tags (use is property): | |
* x-googlemap (iframe with api-key & address properties) | |
be sure to enable polyfill: https://github.com/WebReflection/document-register-element | |
*/ | |
(function() { | |
var GoogleMapProto = Object.create(HTMLElement.prototype); |
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 simplecart.discounts.models import * | |
from simplecart.orders.models import SKU | |
from decimal import Decimal | |
import datetime | |
from django import forms | |
class r(str): | |
pass |
OlderNewer