Skip to content

Instantly share code, notes, and snippets.

@nchaulet
nchaulet / gist:5857025
Last active December 18, 2015 22:49
timeline Build.xml
<?xml version="1.0" encoding="UTF-8"?>
<project name="timeline" default="build" basedir="../../../">
<!-- ================================================================== -->
<!-- Construction -->
<!-- ================================================================== -->
<target name="build" depends="clean-up, init, checkstyle, tests" />
<!-- =================================================================== -->
<!-- Nettoyage des éléments temporaires -->
@nchaulet
nchaulet / gist:5857049
Last active December 18, 2015 22:49
test mocha
describe('test class timeline', function(){
beforeEach(function() {
timeline = new Timeline(10);
});
describe('#addMessage method' , function() {
it('when i add message timeline.data must contain this message', function() {
var message = {
// On lance le serveur node à tester
var server = require('../../server.js');
var request = require('supertest');
var request = request('http://localhost:3334');
describe('Test backend API ' , function () {
describe('Test Write message then delete it ', function(){
@nchaulet
nchaulet / gist:5875142
Last active December 19, 2015 01:19
Generator websocket-bench
(function() {
exports.beforeConnect = function(client) {
// On ne veut pas que les clients utilisent de websocket
client.disable('websocket');
};
exports.onConnect = function(client, done) {
@nchaulet
nchaulet / gist:5934254
Created July 5, 2013 12:37
cli websocket-bench
websocket-bench -a 25000 -c 1000 http://<domaine>.fr:66666 -g generator.js
@nchaulet
nchaulet / elasticraspberry.md
Last active December 25, 2015 17:39
ElasticSearch raspberry

Install Java

sudo apt-get install oracle-java7-jdk

Download

wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.5.zip
@nchaulet
nchaulet / composer-hhvm.md
Created January 6, 2014 19:24
Composer with HHVM

Composer with HHVM

Tips :

If your dependencies needs ext-intl or ext-gmp you can add this to your composer.json

#!/bin/sh
mv composer.json composer.tmp
cat composer.tmp | jq '.provide = { "ext-gmp" : "*", "ext-intl" : "*", "lib-icu": "*" }' > composer.json
hhvm /usr/local/bin/composer $@
mv composer.tmp composer.json
hash=`md5sum composer.json | awk '{ print $1 }'`
mv composer.lock composer.lock.tmp
cat composer.lock.tmp | jq ".hash = \"$hash\"" > composer.lock
rm composer.lock.tmp
<rss version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>Flux Slideshow</title>
<language>fr</language>
<link></link>
<description>Slideshow</description>
<item>
<guid isPermaLink="false">74409</guid>
<title>Goodwood Festival of Speed 2014 : toutes nos photos</title>
<description>Goodwood Festival of Speed 2014 : toutes nos photos</description>
@nchaulet
nchaulet / test.conf
Last active August 29, 2015 14:05
test.conf
input {
gelf {
type => "gelf"
}
}
output {
elasticsearch {
embedded => true
}