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
debug = False | |
priority_plugins = "uber", | |
[cherrypy] | |
engine.autoreload.on = False | |
server.socket_host = "127.0.0.1" | |
server.socket_port = 8282 | |
server.socket_timeout = 1 | |
server.thread_pool = 100 | |
tools.proxy.debug = False |
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
cherrypy_mount_path = "/reggie" | |
url_root = "https://%(hostname)s" | |
organization_name = "MAGFest INC" | |
event_year = 2020 | |
event_name = "MAGFest" | |
event_timezone = "US/Eastern" | |
event_venue = "The Gaylord National Hotel and Convention Center" | |
event_venue_address = "201 Waterfront St, National Harbor, MD 20745" | |
send_emails = True | |
send_sms = False |
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
/** | |
* This modules exports an Angular 2 WebSocketService implementing Sideboard's | |
* WebSocket RPC protocol. There are three main actions exposed to consumers: | |
* calling RPC methods, making subscriptions, and canceling subscriptions. | |
* | |
* | |
* Calling RPC Methods | |
* ------------------- | |
* Consumers can make one-off RPC calls which return promises: | |
* |
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 collections import defaultdict | |
from sideboard.lib import notify, listify, threadlocal | |
__all__ = ['get', 'send'] | |
ecards = defaultdict(list) | |
class user_subscribes(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
from __future__ import unicode_literals, print_function | |
import re | |
import random | |
import traceback | |
from functools import wraps | |
from datetime import datetime | |
from threading import Event, Thread, current_thread | |
from six.moves.queue import Queue, Empty |
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 cherrypy | |
class Root(object): | |
@cherrypy.expose | |
def index(self): | |
raise cherrypy.HTTPRedirect('/') | |
if __name__ == '__main__': | |
cherrypy.quickstart(Root()) |
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
""" | |
To use Flask with Sideboard, make a plugin and then put this file in the plugin | |
module's directory, e.g. sideboard/plugins/paper_bag/paper_bag/__init__.py and | |
the Flask site will be available at https://localhost:4443/uber/paper_bag | |
""" | |
import cherrypy | |
from cherrypy import wsgiserver | |
from flask import Flask | |
app = Flask(__name__) |
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
My main problem with Perl is references and contexts. Most of the experienced programmers I've worked with find themselves unable to write or debug code that requires the use of these Perl concepts. | |
For example, my co-workers and I find it easy and intuitive to work with lists in Python: | |
xs = [5, 6] | |
xs.append(7) | |
print xs[2] # prints 7 | |
xs.append([]) # easy to append lists to other lists | |
xs[3].append(6) # easy to append to the inner list | |
some_func(12, "hello", xs, True) # easy to pass to a 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
# Current version: | |
def csv_file(func): | |
@wraps(func) | |
def csvout(self, session): | |
cherrypy.response.headers['Content-Type'] = 'application/csv' | |
cherrypy.response.headers['Content-Disposition'] = 'attachment; filename=' + func.__name__ + '.csv' | |
writer = StringIO() | |
func(self, csv.writer(writer), session) | |
return writer.getvalue().encode('utf-8') |
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
path = "/uber" | |
hostname = "50.56.242.7" | |
url_root = "http://50.56.242.7:8282" | |
dev_box = True | |
send_emails = False | |
collect_exact_birthdate = True | |
event_name = "MAGStock" | |
organization_name = "MAGStock" | |
groups_enabled = False |
NewerOlder