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
#include <lua.hpp> | |
class Lua { | |
public: | |
static class Nil { Nil(); } nil; | |
Lua() { | |
L=luaL_newstate(); | |
} |
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
<!-- tools.pt --> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:i18n="http://xml.zope.org/namespaces/i18n" | |
xmlns:meta="http://xml.zope.org/namespaces/meta" | |
xmlns:metal="http://xml.zope.org/namespaces/metal" | |
xmlns:tal="http://xml.zope.org/namespaces/tal" | |
meta:interpolation="true" | |
tal:condition="False"> | |
<metal:tooltip define-macro="tooltip"> |
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 unittest | |
import pyramid.testing | |
class RedisTempStoreTests(unittest.TestCase): | |
def setUp(self): | |
from .tmpstore import DummyRedis | |
self.config = pyramid.testing.setUp() | |
self.config.registry.settings['redis'] = self.redis = DummyRedis() |
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
#: Mapping of language codes send by browsers to supported dialects. | |
BROWSER_LANGUAGES = { | |
'en-CA': 'en_CA', | |
'en-GB': 'en_GB', | |
'en-US': 'en_GB', | |
'en': 'en_GB', | |
'nl': 'nl_NL', | |
'nl-NL': 'nl_NL', | |
'nl-BE': 'nl_NL', | |
'zh': 'zh_CN', |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Javascript error handling logic</title> | |
</head> | |
<body> | |
<script type="text/javascript" src="https://github.com/downloads/eriwen/javascript-stacktrace/stacktrace-0.4.js"></script> | |
<script type="text/javascript"> | |
// <![CDATA[ | |
// ]]> |
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 argparse | |
import os | |
import re | |
import sys | |
from lxml import etree | |
def read(fn): | |
with open(fn, 'r') as input: | |
parser = etree.HTMLParser() |
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
<form id="loginForm" method="post" action="${request.route_url('login')}"> | |
<input type="hidden" name="csrf_token" value="${request.session.get_csrf_token()}"/> | |
<fieldset class="concise"> | |
<metal:field tal:define="name 'came_from'" use-macro="snippets['hidden']"/> | |
<metal:field tal:define="name 'login'" use-macro="snippets['text']"/> | |
<metal:field tal:define="name 'password'" use-macro="snippets['password']"/> | |
</fieldset> | |
<div class="buttonBar"> | |
<button type="submit" class="default" i18n:translate="">Login</button> | |
</div> |
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
#include <string> | |
#include <boost/uuid/uuid.hpp> | |
#include <boost/uuid/nil_generator.hpp> | |
#include <boost/uuid/string_generator.hpp> | |
#include <boost/uuid/uuid_io.hpp> | |
#include <boost/python.hpp> | |
namespace python = boost::python; |
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
#include <boost/algorithm/string/join.hpp> | |
#include <boost/format.hpp> | |
#include <boost/regex.hpp> | |
#include <boost/uuid/uuid_generators.hpp> | |
#include <boost/uuid/uuid_io.hpp> | |
#include <stylist/private/pqxx.hh> | |
using namespace std; | |
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 enqueue(request, queue, func, *a, **kw): | |
"""Queue a function call. | |
:param request: Pyramid request object | |
:param queue: name of the rq queue to use | |
:param func: function or instance method to call | |
:return: rq job instance | |
>>> enqueue(request, 'email', myfunc, arg1, arg2) | |
""" |
OlderNewer