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 scala.concurrent.Await | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.duration._ | |
import scala.concurrent.Future | |
import scala.util.Random | |
import akka.actor.{ActorSystem, Actor, Props} | |
import akka.pattern.ask | |
import akka.util.Timeout | |
import akka.routing.RoundRobinPool |
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 mezzanine.pages.models import RichTextPage | |
def generate_page_tree(per_branch): | |
for a in range(per_branch): | |
x = RichTextPage.objects.create(title="Page %s" % a) | |
for b in range(per_branch): | |
y = RichTextPage.objects.create(title="Page %s-%s" % (a, b), parent=x) | |
for c in range(per_branch): | |
z = RichTextPage.objects.create(title="Page %s-%s-%s" % (a, b, c), parent=y) |
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
{% load pages_tags future %} | |
<ol> | |
{% for page in page_branch %} | |
<li id="ordering_{{ page.id }}"> | |
<div> | |
<a href="#" class="tree-toggle" id="page-{{ page.id }}" | |
{% if not page.has_children %}style="visibility:hidden;"{% endif %}> | |
<span class="icon open">+</span> | |
<span class="icon close">-</span> |
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 scala.math.{floor, log} | |
import scala.util.Random | |
import akka.actor.{ActorSystem, Actor, Props} | |
object MergeSort extends App { | |
case class Items(items: Vector[Int]) |
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 is the gunicorn config file for the websocket server. | |
worker_class = "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" | |
bind = "0.0.0.0:9000" | |
workers = 1 | |
timeout = 10000000000 | |
loglevel = "error" | |
proc_name = "websocket-server" | |
# Modify paths here as required - allows websocket server to run |
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 | |
import os | |
import sys | |
import github | |
username = "stephenmcd" | |
while True: |
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
~ redis-cli EVAL "return redis.call('EVAL', 'return redis.call(\'EVAL\', \'return redis.call(\\\\\'TIME\\\\\')\', 0)', 0)" 0 | |
1) (integer) 227734 | |
2) (integer) 541653 |
OlderNewer