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
module Main where | |
import Control.Concurrent (forkIO) | |
import Control.Monad (forever, unless) | |
import Network (PortID(PortNumber),listenOn) | |
import Network.Socket hiding (listen,recv,send) | |
import Network.Socket.ByteString (recv,sendAll) | |
import qualified Data.ByteString as S | |
import System.Posix (Handler(Ignore),installHandler,sigPIPE) |
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 net.liftweb.http._ | |
import S._ | |
import js._ | |
import JsCmds._ | |
import JE._ | |
import net.liftweb.util._ | |
import Helpers._ | |
import scala.xml.Text | |
class AjaxCall { |
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.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.servlet.ServletHandler; | |
import org.eclipse.jetty.servlets.ProxyServlet; | |
import javax.servlet.ServletConfig; | |
import javax.servlet.ServletException; | |
import javax.servlet.ServletRequest; | |
import javax.servlet.ServletResponse; | |
import java.io.IOException; |
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 org.scribe.builder.api; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import org.scribe.exceptions.OAuthException; | |
import org.scribe.extractors.AccessTokenExtractor; | |
import org.scribe.model.OAuthConfig; | |
import org.scribe.model.OAuthConstants; | |
import org.scribe.model.OAuthRequest; |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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.view | |
import _root_.scala.xml.{ NodeSeq, Node, Elem, PCData, Text } | |
import _root_.net.liftweb.common._ | |
import _root_.net.liftweb.util._ | |
import _root_.net.liftweb.http._ | |
import _root_.net.liftweb.http.js._ | |
import JsCmds._ | |
import JE._ | |
import 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
#!/bin/sh | |
echo "assumes java 7 is instlaled openjdk versio" | |
#pre dependencies | |
sudo apt-get install git-core pkg-config libtool automake make g++ connect-proxy unzip python | |
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 | |
#install zeromq | |
git clone git clone git://github.com/zeromq/libzmq.git |
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
/** | |
* © 2012 Typesafe Inc. | |
* | |
* Extracted from http://doc.akka.io/docs/akka/2.1.0-RC2/scala/io.html | |
*/ | |
import akka.actor._ | |
import akka.util.{ ByteString, ByteStringBuilder } | |
import java.net.InetSocketAddress |
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
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
Manage multiple hostnames (domains, sub-domains) within a single instance of CodeIgniter. | |
Example: | |
If you had the following domain/sub-domain style for your site: | |
your-domain.com |
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
#!/bin/sh | |
set -o xtrace | |
# A script to bootstrap cabal-install. | |
# It works by downloading and installing the Cabal, zlib and | |
# HTTP packages. It then installs cabal-install itself. | |
# It expects to be run inside the cabal-install directory. | |
# install settings, you can override these by setting environment vars |
OlderNewer