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
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
</head> | |
<body> | |
<form> | |
<input type="file" accept="image/*" id="capture" capture="camera"> | |
<img id="blah" src="#" alt="your image"/> | |
</form> |
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
sub vcl_hash { | |
set req.hash += req.url; | |
set req.hash += req.http.host; | |
set req.http.X-Calc-Hash = "true"; | |
if( req.http.Cookie ~ "JSESSIONID" ) { | |
set req.http.X-Varnish-Hashed-On = | |
regsub( req.http.Cookie, "^.*?JSESSIONID=([a-zA-z0-9]{32}\.[a-zA-Z0-9]+)([\s$\n])*.*?$", "\1" ); |
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.edate.data.test | |
import java.util.Properties | |
import kafka.producer.ProducerConfig | |
import kafka.producer.Producer | |
import kafka.message.Message | |
import kafka.producer.ProducerData | |
import kafka.producer.ProducerData | |
import kafka.producer.Partitioner | |
/** |
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
%% mod_js is a prototype module that uses erlang_js | |
%% to allow filtering stanza's through JavaScript | |
%% for altering, dropping, etc. | |
%% | |
%% NOTE: The JavaScript path is hardcoded to "test.js" | |
%% at the end of this file. | |
%% | |
-module(mod_js). | |
-author('hisham.mardambey@gmail.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
/** | |
* Notes: This code uses AsyncValue[T], a custom class that uses actors | |
* to allow concurrent operations on the provided type. It can be replaced | |
* by an Atomic object from the java.util.concurrent package or something | |
* that provides similar functionality. | |
*/ | |
/** | |
* Resets the offsets for the given group / topic pair. |
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.actors.Actor | |
case class Set(value:Any) | |
case class Get() | |
case class Destroy() | |
/* | |
* An actor wrapping an object of type T providing async get/set | |
* calls without blocking (sacrificing accuracy). | |
* |
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
object ConsistentHashRouter { | |
/** | |
* Creates a new ConsistentHashRouter, routing to the specified routees | |
*/ | |
def apply(routees: Iterable[ActorRef]): ConsistentHashRouter = | |
new ConsistentHashRouter(routees = routees map (_.path.toString)) | |
} | |
case class ConsistentHashRouter( |
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 redis.clients.jedis; | |
import java.util.HashSet; | |
import java.util.Set; | |
import java.util.logging.Logger; | |
public class JedisSentinelPoolRunner { | |
private static Logger log = Logger.getLogger(JedisSentinelPoolRunner.class.getName()); | |
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 java.io.{FilterOutputStream, IOException, OutputStream} | |
class LimitedOutputStream(out: OutputStream , maxBytes: Long) extends FilterOutputStream(out) { | |
private var bytesWritten: Long = 0L | |
@throws(classOf[IOException]) | |
override def write(b: Int) { | |
ensureCapacity(1) | |
super.write(b) |
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
%% | |
%% mod_msg_filter allows the filtering of "message" | |
%% stanzas across an HTTP service. The URL of the | |
%% service must be passed as part of the module's | |
%% configuration. Both JIDs and their resources are | |
%% passed as part of the query string and the result | |
%% is expected to be one of: | |
%% | |
%% <status value="denied"> | |
%% <stanza1><error/></stanza1> |
OlderNewer