This file contains hidden or 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
var cloudfront = require('./cloudfront.io'); | |
var infrastructure = new cloudfront.infrastructure(); | |
infrastructure.discover('memcache') | |
.enter(function(instance, done) { | |
// do something when a new memcache instance joins | |
done(); // callback required for ATOMIC acknowledgement (same concept as QUnit) | |
}) | |
.exit(function(instance, done) { | |
// do something when an instance has leaves |
This file contains hidden or 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
var cloudfront = require('./cloudfront.io'); | |
var infrastructure = new cloudfront.infrastructure(); | |
// announce that there is a memcache instance available | |
// to the collective | |
infrastructure.announce('memcache', { | |
ip: '<yourip>', | |
port: '<yourport>', | |
tag: '<sometag you care about>' | |
}, 5000); |
This file contains hidden or 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
infrastructure | |
.discover('solr') | |
.enter(function(instance) { // when a new instance has announced itself or come online again | |
// instance.port | |
// instance.core | |
// instance.ip | |
// instance.ttl | |
}) | |
.exit(function(instance) { // when an instance has left | |
// when an instance has left we can now unregister it |
This file contains hidden or 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 should be served by your server --> | |
<script src="/socket.io/socket.io.js"></script> | |
<script> | |
var socket = io.connect('http://localhost'); | |
socket.on('news', function (data) { | |
console.log(data); | |
socket.emit('my other event', { my: 'data' }); | |
}); | |
</script> |
This file contains hidden or 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
// Show how to handle Ctrl+C in Node.js | |
var zmq = require('zmq') | |
, socket = zmq.createSocket('rep'); | |
socket.on('message', function(buf) { | |
// echo request back | |
socket.send(buf); | |
}); |
This file contains hidden or 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 | |
export JAVA_HOME=/opt/java/current | |
export EC2_PRIVATE_KEY=/home/ubuntu/cloudstrap.io/modules/amazon/files/certs/pk.pem | |
export EC2_CERT=/home/ubuntu/cloudstrap.io/modules/amazon/files/certs/cert.pem | |
export EC2_HOME=/opt/ec2-api-tools-1.5.3.1 | |
export PATH=$PATH:$EC2_HOME/bin | |
ec2-describe-tags --filter "resource-type=instance" --filter "key=node" | while read x; | |
do | |
node=`echo $x | awk '{print $5}'` |
This file contains hidden or 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
/** | |
* Author - Shutupandcode - Terrance A. Snyder (http://www.shutupandcode.net & http://www.terranceasnyder.com) | |
* w/ http://stackoverflow.com/users/36174/actual | |
* | |
* HyperLogLog implementation ripped from: | |
* http://stackoverflow.com/questions/5990713/loglog-algorithm-for-counting-of-large-cardinalities | |
* | |
* However modifications made to allow for intersect, union, etc | |
* to allow for comparing two instances together. | |
* |
This file contains hidden or 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
<%@ page import="org.orbeon.oxf.util.WriterOutputStream" %> | |
<%@ page import="java.io.IOException" %> | |
<%@ page import="java.util.Map" %> | |
<%@ page import="java.util.StringTokenizer" %> | |
<%@ page import="java.util.HashMap" %> | |
<%-- Example which will handle processing a seperate request and include the content back --%> | |
<% | |
out.flush(); | |
final JspWriter myout = out; | |
// Example 1: This gets the current servlet context |
This file contains hidden or 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
<xforms:submission id="orbeonCustomer-submission" | |
class="fr-service" | |
ref="instance('fr-service-request-instance')" | |
action="http://......./orbeonFormsManager/outstanding.action?userId={xxforms:instance('user-instance')/userId}&accountNumber={xxforms:instance('user-instance')/accountNumber}" | |
method="get" | |
separator="&" | |
serialization="application/xml" | |
mediatype="application/xml" | |
replace="instance" | |
xforms:url-type="resource" |
This file contains hidden or 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
select shard | |
FROM (select 0 shard from dual) shards | |
MODEL | |
DIMENSION BY (shard) | |
MEASURES (shard v) | |
RULES UPSERT | |
(v[for shard from 0 to 100 increment 1] = 1) | |
order by 1; |