Skip to content

Instantly share code, notes, and snippets.

View thelinuxlich's full-sized avatar
🐉
Here be dragons

Alisson Cavalcante Agiani thelinuxlich

🐉
Here be dragons
View GitHub Profile
@thelinuxlich
thelinuxlich / doc.json
Created April 10, 2017 19:51
average doc
{
"client_id": 46 ,
"fields": { } ,
"has_fc": false ,
"id": "00002462-a899-5deb-86b6-b3467ed1ca4a" ,
"is_a": true ,
"special": {
"email": "anonymous" ,
"session_count": 1 ,
Dec 07 06:24:44 aidax-rethinkdb-2 systemd[1]: Stopping RethinkDB database server for instance 'instance1'...
Dec 07 06:24:44 aidax-rethinkdb-2 rethinkdb[5989]: Server got SIGTERM from pid 1, uid 0; shutting down...
Dec 07 06:24:44 aidax-rethinkdb-2 rethinkdb[5989]: Shutting down client connections...
Dec 07 06:24:44 aidax-rethinkdb-2 rethinkdb[5989]: All client connections closed.
Dec 07 06:24:44 aidax-rethinkdb-2 rethinkdb[5989]: Shutting down storage engine... (This may take a while if you had a lot of unflushed data in the writeback cache.)
Dec 07 06:25:09 aidax-rethinkdb-2 rethinkdb[5989]: Disconnected from server "aidax_rethinkdb_5_avf" e8b3a46a-fab5-4c99-b4a7-3874ad6cf68d
Dec 07 06:25:16 aidax-rethinkdb-2 rethinkdb[5989]: Version: rethinkdb 2.3.5 (GCC 4.8.5)
Dec 07 06:25:16 aidax-rethinkdb-2 rethinkdb[5989]: error: Error in src/arch/runtime/thread_pool.cc at line 367:
Dec 07 06:25:16 aidax-rethinkdb-2 rethinkdb[5989]: Version: rethinkdb 2.3.5 (GCC 4.8.5)
Dec 07 06:25:16 aidax-rethinkdb-2 rethinkdb[5989]
@thelinuxlich
thelinuxlich / ioredis_log
Created November 3, 2016 17:09
Ioredis log when it fails to reconnect to the cluster
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:cluster command get is moved to 10.240.100.31:7000
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:redis write command[0] -> get(id_a:34:😜)
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:cluster getting slot cache from 10.240.21.41:7001
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:redis status[10.240.21.41:7001]: wait -> connecting
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:redis queue command[0] -> cluster(slots)
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:cluster command get is moved to 10.240.100.31:7000
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:redis write command[0] -> get(id_a:34:😜)
Nov 03 15:15:00 aidax-collector-2 aidax[7708]: Thu, 03 Nov 2016 15:15:00 GMT ioredis:redis status[10.2
@thelinuxlich
thelinuxlich / form_submit.js
Created July 19, 2016 18:05
Form Submit with delay for Analytics
$('#form_id').submit(function(e) {
var form = this;
e.preventDefault(); // disable the default submit action
ax.identify(email);
$(':input', this).attr('disabled', true); // OPTIONAL: disable all elements in the form, to avoid multiple clicks
setTimeout(function() { // after 1 second, submit the form
form.submit();
@thelinuxlich
thelinuxlich / form_analytics.js
Last active June 1, 2016 23:12
form_analytics.js
var actions = {};
$(document).on("submit", ".data-ax-form", function(e) {
if (!$(this).attr("data-ax-submitted")) {
var form_id = $(this).attr("id"),
response = {
total_time_spent: 0,
total_hesitation_time: 0,
most_time_spent_field: 0,
minus_time_spent_field: 0,
module.exports = {
"rules": {
"no-console": false,
"indent": [
2,
4
],
"quotes": [
2,
"double"
@thelinuxlich
thelinuxlich / get_href.js
Created February 16, 2016 20:22
getHref
var urlencode = function(str) {
return encodeURIComponent(str)
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')
.replace(/!/g, '%21')
.replace(/\*/g, '%2A')
.replace(/~/g, '%7E');
},
getHref = function() {
var href = '';
Traceback (most recent call last):
File "/usr/bin/rethinkdb-dump", line 9, in <module>
load_entry_point('rethinkdb==1.14.0-0', 'console_scripts', 'rethinkdb-dump')()
File "/usr/lib/python2.7/site-packages/rethinkdb/_dump.py", line 157, in main
run_rethinkdb_export(options)
File "/usr/lib/python2.7/site-packages/rethinkdb/_dump.py", line 140, in run_rethinkdb_export
do_zip(temp_dir, options)
File "/usr/lib/python2.7/site-packages/rethinkdb/_dump.py", line 123, in do_zip
res = subprocess.call(tar_args)
File "/usr/lib64/python2.7/subprocess.py", line 524, in call
@thelinuxlich
thelinuxlich / naive_benchmark
Created December 18, 2013 20:56
Result of a simple benchmark using Express.js and Partial.js(latest versions of both)
Express.js:
Transactions: 1500 hits
Availability: 100.00 %
Elapsed time: 6.10 secs
Data transferred: 0.24 MB
Response time: 0.06 secs
Transaction rate: 245.90 trans/sec
Throughput: 0.04 MB/sec
Concurrency: 14.90
dynamo.batchRead({
'interaction_links': [['internal_tests','146a0297335486e05ac53e8532c18dde3ac375e5']],
'action_history': [['myerp:jonathan.huesca@biodiagnosticos.com','1383088503200']]
},function(err,data){
if(!!err) {
self.log("ERROR on batch reading: "+err);
} else {
self.log(JSON.stringify(data));
}
});