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 com.mojolly.backchat | |
package redis | |
package resque | |
import com.mojolly.backchat.redis.resque.Resque.{ResqueWorkerActor} | |
import net.liftweb.json._ | |
import JsonAST._ | |
import JsonDSL._ | |
import java.net.InetAddress | |
import com.redis.ds.{ RedisDeque, RedisDequeClient } |
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 unfiltered.jetty._ | |
import unfiltered.request._ | |
import unfiltered.response._ | |
import unfiltered.filter._ | |
import unfiltered.Cookie | |
trait AuthService[T]{ | |
def auth(username: String, password: String): Option[T] | |
} |
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 ya | |
import scala.util.parsing.combinator._ | |
import scala.util.parsing.input._ | |
import scalax.file.Path | |
import scala.io.Source | |
class BytePosition(index: Int) extends Position { |
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 | |
# coding: utf-8 | |
# You need PIL <http://www.pythonware.com/products/pil/> to run this script | |
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use | |
# any TTF you have) | |
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com] | |
# License: GPL <http://www.gnu.org/copyleft/gpl.html> | |
from image_utils import ImageText |
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
-- Suggested changes for http://codereview.stackexchange.com/q/7623/4949 | |
module Nim where | |
import Data.List | |
import Data.Maybe | |
import qualified Data.Map as Map | |
--Domain | |
--Nim is a mathematical game of strategy |
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 com.vast.example | |
import java.net.InetSocketAddress | |
import java.util.UUID | |
import java.util.concurrent.{Executors, TimeUnit} | |
import com.google.common.base.Splitter | |
import com.twitter.finagle.http.Http | |
import com.twitter.finagle.builder.{Server, ServerBuilder} | |
import com.twitter.finagle.service.TimeoutFilter | |
import com.twitter.finagle.{Service, SimpleFilter, GlobalRequestTimeoutException} |
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
case class ReaderWriterStateT[R, W, S, F[_], A]( | |
run: (R, S) => F[(W, A, S)] | |
) { | |
def map[B](f: A => B)(implicit F: Functor[F]) | |
: ReaderWriterStateT[R, W, S, F, B] = | |
ReaderWriterStateT { | |
case (r, s) => F.map(run(r, s)) { | |
case (w, a, s) => (w, f(a), s) | |
} | |
} |
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
/* | |
g++ main.cpp -lboost_system -lboost_thread -lpthread -o main | |
*/ | |
#include <boost/asio.hpp> | |
#include <boost/array.hpp> | |
#include <iostream> | |
void send_something(std::string host, int port, std::string message) |
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 directoryhash import path_checksum | |
from functools import partial | |
def static(filename, _external=False): | |
path = partial(url_for, 'static', filename=filename, _external=_external) | |
host = app.config.get('CDN_HOSTNAME') | |
if host: | |
return u'http://{host}/{fingerprint}{path}'.format( | |
host=host, fingerprint=g.fingerprint, path=path()) | |
return path(fingerprint=g.fingerprint) |
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
{-# LANGUAGE OverloadedStrings #-} | |
-- | Wai+Warp file server. Used GHC 7.4, Wai 1.1, Warp 1.1 versions. | |
module Main where | |
import Network.Wai.Handler.Warp (run) | |
import Network.Wai.Application.Static | |
( StaticSettings(..) | |
, staticApp | |
, fileSystemLookup |
OlderNewer