Skip to content

Instantly share code, notes, and snippets.

View lbdremy's full-sized avatar

Remy Loubradou lbdremy

View GitHub Profile
@lbdremy
lbdremy / http-csv-objectmapper-json-solr.js
Created September 3, 2012 08:29
How to rule a data feed with node.js
console.time('Zuneta-stream');
/**
* Modules dependencies
*/
var csv = require('csv-stream'),
request = require('request'),
objectMapper = require('object-mapper-stream'),
solr = require('solr-client'),
crypto = require('crypto');
@lbdremy
lbdremy / learning-opt-v8.md
Created September 30, 2012 00:24
learning how to optimize js code with v8
node --trace-opt --trace-bailout bench/parse.js 
[marking Parser.parse 0x1aaeac0a128 for recompilation, reason: hot and stable, ICs with typeinfo: 59/95 (62%)]
Bailout in HGraphBuilder: @"Parser.parse": SwitchStatement: non-literal switch label
[disabled optimization for Parser.parse]
[marking EventEmitter.emit 0x1f0e63861860 for recompilation, reason: not much type info but very hot, ICs with typeinfo: 2/70 (2%)]
[optimizing: EventEmitter.emit / 1f0e63861861 - took 1.649 ms]
[marking EventEmitter 0x1aaeac2bbb0 for recompilation, reason: small function, ICs with typeinfo: 1/5 (20%)]
[marking createParser 0x1aaeac38f88 for recompilation, reason: small function, ICs with typeinfo: 0/0 (100%)]
[optimizing: createParser / 1aaeac38f89 - took 0.124 ms]
@lbdremy
lbdremy / profile-jsonparse.md
Created October 6, 2012 01:31
Profile jsonparse

1° profiling:

lbdremy@lbdremy-Latitude-E6500:~/workspace/nodejs/jsonparse$ node --trace-opt --trace-bailout bench.js 
[marking toLowerCase 0x2101a5499e8 for recompilation, reason: small function, ICs with typeinfo: 0/2 (0%)]
[optimizing: toLowerCase / 2101a5499e9 - took 0.804 ms]
[marking parse 0x2101a54a4e0 for recompilation, reason: small function, ICs with typeinfo: 2/4 (50%)]
[optimizing: parse / 2101a54a4e1 - took 0.134 ms]
[marking IsPrimitive 0x2101a553578 for recompilation, reason: small function, ICs with typeinfo: 0/0 (100%)]
[marking NonStringToString 0x2101a552338 for recompilation, reason: small function, ICs with typeinfo: 2/2 (100%)]
Bailout in HGraphBuilder: @"NonStringToString": call to a JavaScript runtime function
@lbdremy
lbdremy / template-upstart-script-node-app.conf
Created December 24, 2012 12:17
Template of an _upstart_ script for a node.js app.
description "your description"
author "your name <name@sld.tld>"
# Environment variables
env APP_CONFIG=/home/web/app/config.json
env APP_USER=myapp
env APP_SCRIPT=/home/web/app/index.js
env NODE_ENV=production
env PID_FILE=/var/run/app.pid
env STDERR_LOG_FILE=/var/log/app/stderr.log

Soirée du nouvel an 2012-2013!

Lieu

Chez ma soeur à la vache à Toulouse. Il y a un parking immense disponible à 500 mètres de l'appartement.

Plan

18h30: Début des derniers préparatifs

># java -ea:org.apache.lucene -cp /var/lib/chef/solr/solr-jetty/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib/lucene-core-2.9-dev.jar org.apache.lucene.index.CheckIndex -fix /var/cache/chef/solr/data/index/
@lbdremy
lbdremy / click-reference-affiliate-networks.md
Last active December 4, 2023 16:14
click reference parameter in a bunch of affiliate networks. Feel free to contribute, add and remove errors.

- Affiliate network name - &parameter=value_of_the_click_reference_here_CLICKREF

  • Advortis - &xref1=CLICKREF
  • Affiliate Future - &tracking=CLICKREF
  • Affiliate Window - &clickref=CLICKREF
  • Affilinet - &subid=CLICKREF
  • Aflite - &aref=CLICKREF
  • Brand Conversions - &subid=CLICKREF
  • Buyat - &LID=CLICKREF
  • Carpet Right Affiliates - &link_ref=CLICKREF
  • ClixGalore - &OID=CLICKREF
@lbdremy
lbdremy / poc-ga.js
Created February 25, 2013 17:50
Using OAuth 2.0 for Server to Server Applications and the Google Analytics API with node.js.
/**
* Module dependencies
*/
var GA = require('googleanalytics'),
jwt = require('jwt-sign'),
request = require('superagent'),
fs = require('fs'),
privateKey = fs.readFileSync(process.env['GA_PATH_PRIVATE_KEY'] || __dirname + '/key/private.pem','utf8');
@lbdremy
lbdremy / solr-logs-into-syslog.md
Created April 19, 2013 15:29
Solr logs into syslog

Solr and Syslog friend again

Configuration file

etc/logging.properties

#
# Licensed to the Apache Software Foundation (ASF) under one or more