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
const map = [ | |
[4690, 0], | |
[4648, 20.0], | |
[4480, 30.0], | |
[4340, 45.0], | |
[4172, 60.0], | |
[3976, 80.0], | |
[3752, 100.0], | |
[3276, 150.0], | |
[2772, 200.0], |
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
sudo yum update -y | |
sudo yum install htop -y | |
# Install Erlang | |
sudo yum install https://github.com/rabbitmq/erlang-rpm/releases/download/v21.3.4/erlang-21.3.4-1.el7.x86_64.rpm -y | |
# Install RabbitMQ | |
sudo yum install https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.14/rabbitmq-server-3.7.14-1.el7.noarch.rpm -y | |
# Allow remote connections |
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
const { resolve: resolvePath } = require('path'); | |
module.exports = (babel) => ({ | |
visitor: { | |
Identifier(path, state) { | |
if (path.node.name === 'window') { | |
if (!path.scope.hasBinding('window')) { | |
const fileName = resolvePath(state.file.opts.filenameRelative); | |
const { start } = path.node.loc; | |
console.warn(`Global window is touched at ${fileName}:${start.line}:${start.column}`); |
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
const path = require('path'); | |
const fs = require('fs'); | |
const express = require('express'); | |
const semver = require('semver'); | |
const app = express(); | |
/** | |
* Get list of available files | |
*/ |
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
- ARCHIVE cluster (m1.xlarge) | |
- 4x HDD | |
- 8 ECU | |
- 15GiB mem | |
- 10 shards per node | |
- concurrency 1 | |
┌────────────────────────────┬───────┬─────┬───────┬────────┬─────────┬─────────┐ | |
│ index hit │ calls │ min │ max │ median │ mean │ 95 perc │ | |
├────────────────────────────┼───────┼─────┼───────┼────────┼─────────┼─────────┤ |
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
filter AND vs BOOL | |
shards: 1 * 2 | docs: 59,925,838 | size: 23.51GB | |
=== and filter === | |
filter cache: 4.8 GiB | |
┌────────────────────────────────┬───────┬─────┬─────┬────────┬───────┬─────────┐ | |
│ type │ calls │ min │ max │ median │ mean │ 95 perc │ | |
├────────────────────────────────┼───────┼─────┼─────┼────────┼───────┼─────────┤ | |
│ total │ 1500 │ 1 │ 113 │ 4 │ 8.51 │ 26 │ | |
├────────────────────────────────┼───────┼─────┼─────┼────────┼───────┼─────────┤ |
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
require 'mina/git' | |
require 'json' | |
set :domain, '0.0.0.0' | |
set :user, 'nodejs' | |
set :deploy_to, '/home/nodejs/api' | |
set :repository, 'git@.../api.git' | |
set :branch, 'master' | |
set :shared_paths, [ 'tmp' ] | |
set :term_mode, :pretty |
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
{"profile_week": { | |
"type": "document", | |
"ids": ["446640741", "791886", "18338026", "14586934", "418565259", "272996263", "89724652", "593801316", "71065764", "56225142"], | |
"rows": 37027, | |
"many_fields": { | |
"unique_names": 24, | |
"sample_names": ["1330300800", "1335139200", "1328486400", "1332115200", "1329696000", "1336953600", "1339372800", "1331510400", "1336348800", "1349654400", "1338163200", "1329091200", "1333324800", "1339977600", "1334534400", "1330905600", "1337558400", "1332720000", "1333929600", "1335744000", "1338768000", "1327276800", "1326672000", "1327881600"], | |
"type": "object", | |
"fields": { | |
"date": { |
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
-- Column: vectors type of tsvector | |
ALTER TABLE profiles.fact__profile ADD COLUMN vectors tsvector; | |
-- Fill column: vectors (fulltext index) | |
UPDATE profiles.fact__profile | |
SET tsvector = to_tsvector('english', identifier || ' ' || title); |
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
require('cson-config').load() | |
brokerClient = require 'broker-client' | |
config = process.config | |
app = brokerClient config.broker | |
# middleware | |
app.use (req, res, next)-> | |
console.log "#{req.method} #{req.path} from #{req.headers['x-forwarded-for']}" |
NewerOlder