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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
"github.com/centrifugal/centrifugo/libcentrifugo/stringqueue" | |
) |
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
package main | |
import ( | |
"errors" | |
"testing" | |
"time" | |
"github.com/centrifugal/centrifugo/libcentrifugo/stringqueue" | |
) |
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 tempfile | |
import hotshot | |
import hotshot.stats | |
def profile(func): | |
def wrapper(request, *args, **kwargs): | |
tmpfile = tempfile.NamedTemporaryFile() | |
prof = hotshot.Profile(tmpfile.name) | |
result = prof.runcall(func, request, *args, **kwargs) |
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
require 'formula' | |
class Tarantool < Formula | |
homepage 'http://tarantool.org' | |
url 'http://tarantool.org/dist/master/tarantool-1.6.6-249-g82c0c4d-src.tar.gz' | |
sha256 '3f31e37e7c2a6fed9d472abe440892f6aaf16ef9867ed475f5a67804a342d673' | |
head 'https://github.com/tarantool/tarantool.git', :using => :git | |
depends_on 'cmake' => :build |
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 | |
# | |
# This is a modified version of initial parser implementation | |
# described here: http://www.poldylicious.de/node/25 | |
import re | |
class ApacheConfig(object): | |
""" |
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
#!/usr/bin/env python | |
# | |
# Copyright 2009 Facebook | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
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
class PersonaAuthHandler(BaseHandler): | |
@tornado.web.asynchronous | |
def post(self): | |
assertion = self.get_argument('assertion') | |
http_client = tornado.httpclient.AsyncHTTPClient() | |
domain = 'localhost' # MAKE SURE YOU CHANGE THIS | |
url = 'https://browserid.org/verify' | |
data = { | |
'assertion': assertion, |
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 <Python.h> | |
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
Py_Initialize(); | |
PyObject* po_operator = PyImport_ImportModule("operator"); | |
PyObject* po_division = PyObject_GetAttrString(po_operator, "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
# coding: utf-8 | |
from datetime import datetime | |
try: | |
import simplejson as json | |
except ImportError: | |
import json | |
datetime_json_handler = lambda obj: obj.isoformat() if isinstance(obj, datetime) else 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
/* | |
Usage: | |
$(document).ready(function() { | |
$('#tabs').prefix_tab({ | |
prefix: 'settings_', | |
default_route: 'general' | |
}); | |
}); |