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
\documentclass[12pt]{article} | |
\usepackage{xltxtra, setspace} | |
%% fonts | |
% xeCJK options from <http://mesokosmos.blogger.de/stories/1818274/>: | |
\usepackage[% | |
boldfont, | |
CJKnumber, |
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 ubuntu:18.04 | |
RUN apt-get update && apt-get install -y python3-pip virtualenv | |
RUN virtualenv -p python3 /env | |
COPY setup.py /root | |
RUN . /env/bin/activate && \ | |
cd /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
import org.apache.log4j.{LogManager, Level} | |
import org.apache.spark.SparkContext | |
import org.apache.spark.streaming.kafka.KafkaUtils | |
import org.apache.spark.streaming.{Seconds, StreamingContext} | |
import scala.concurrent._ | |
import ExecutionContext.Implicits.global | |
object KafkaDoesntShutdown { | |
def main(args: Array[String]) { | |
// get all threads |
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
// convert the HAML/SCAML layout file to Docbook XML | |
val engine = new org.fusesource.scalate.TemplateEngine | |
val output = engine.layout("src/main/docbook/handbook.scaml") | |
val file = (target in Compile).value / "handbook.xml" | |
IO.write(file, output) | |
// create Docbook HTML | |
import scala.sys.process._ | |
// TODO make this independent of local user's environment | |
val xsltool = "xsltproc" |
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
Feature: Basic Appearance | |
Scenario: Loading Front Page | |
Given I go to "http://localhost:8080" | |
Then I should see "WorldWide Conferencing" | |
Scenario: Login fails | |
Given I go to "http://localhost:8080/user_mgt/login" | |
When I fill in "username" with "me@privacy.net" | |
And I fill in "password" with "xyz" |
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 EndlessList { | |
/** | |
* Gets a "page" (e.g., 10 items) of content entities from the database. | |
*/ | |
def getPage(page: Int): (Seq[Content], Boolean) = { | |
val realPage: Int = if (page < 1) 1 else page | |
val limit = 10 | |
val contents = Content.findAll( | |
(/* conditions */), |
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 realHostAndPath(forceNoSsl: Boolean = false): String = | |
S.request.flatMap(req => (Box !! req.request).map(r => { | |
// X-Forwarded-Host contains host *and* port (if not standard) | |
r.header("X-Forwarded-Host") match { | |
case Full(hostAndPort) => | |
r.scheme match { | |
case "http" if r.header("X-SSL").isDefined => | |
"https://" + hostAndPort + S.contextPath | |
case "http" if r.header("X_FORWARDED_PROTO") == Full("https") && !forceNoSsl => | |
// this (correct) URL is not liked well by Java applets, so we allow to override it |
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 code | |
import java.util.{ResourceBundle, Locale} | |
import xml.{Node, NodeSeq} | |
import net.liftweb.util.Helpers.tryo | |
import net.liftweb.http.{Templates, LiftRules, S} | |
import net.liftweb.common._ | |
import net.liftweb.util.{BundleBuilder, Helpers, NamedPF, Props} |
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 code.model | |
import net.liftweb.mongodb.BsonDSL._ | |
import net.liftweb.record.field._ | |
import net.liftweb.util.Helpers._ | |
import net.liftweb.common._ | |
import net.liftweb.mongodb.record._ | |
import field._ | |
import com.mongodb.{DBObject, BasicDBObject} |
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 code.lib | |
import net.liftweb.http.{S, Req} | |
import net.liftweb.sitemap.Loc | |
/** | |
* Loc that matches multiple paths, one for each language. | |
* | |
* @param uris Maps languages to paths, e.g. | |
* Map( |
NewerOlder