Skip to content

Instantly share code, notes, and snippets.

@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

// 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(){
#!/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
@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 / 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 / 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: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 = {
@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 -->
### Keybase proof
I hereby claim:
* I am nchaulet on github.
* I am nchaulet (https://keybase.io/nchaulet) on keybase.
* I have a public key whose fingerprint is 1862 5A45 CD8C 4D53 7833 D9A9 C721 2D1A 81FE 3A70
To claim this, I am signing this object:
@nchaulet
nchaulet / index.html
Last active August 29, 2015 14:10
angular-demo
<!DOCTYPE html>
<html>
<head>
<title>Demo angular</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.min.js"></script>
</head>
<body>
<h1>Demo angular</h1>
<script type="text/javascript">