Skip to content

Instantly share code, notes, and snippets.

/*
EXAMPLE MESSAGE
/poll "question?" "option 1" "option 2"
*/
/** Global Helpers
*
* console - A normal console instance
* _ - An underscore instance
@sampaiodiego
sampaiodiego / test-roles-query-perfomance.js
Last active May 23, 2016 18:23
Enter on a room (for example: https://demo.rocket.chat/channel/general) and run the entire code from the browser console.
var uid = Meteor.userId();
var rid = Session.get('openedRoom');
var roles = _.union((ref = UserRoles.findOne(uid)) != null ? ref.roles : void 0, (ref1 = RoomRoles.findOne({
'u._id': uid,
rid: rid
})) != null ? ref1.roles : void 0);
var f2 = function() {
var ref, ref1;
@sampaiodiego
sampaiodiego / CONTRIBUTING.md
Created June 16, 2016 20:02
Rocket.Chat CONTRIBUTING.md

Contributing to Rocket.Chat

👍🎉 First off, thanks for taking the time to contribute! 🎉👍

The following is a set of guidelines for contributing to Rocket.Chat and its packages, which are hosted in the Rocket.Chat Organization on GitHub.

Note: If there's a feature you'd like, there's a bug you'd like to fix, or you'd just like to get involved please raise an issue and start a conversation. We'll help as much as we can so you can get contributing - although we may not always get back right away :)

ES2016 vs CoffeeScript

function v1(str) {
var hash = 5381;
for (i = 0; i <str.length; i++) {
char = str.charCodeAt(i);
hash = ((hash <<5) + hash) + char; /* hash * 33 + c */
// hash = hash & hash; // Convert to 32bit integer
}
return hash;
}
@sampaiodiego
sampaiodiego / Install Lets Encrypt.md
Last active December 16, 2017 16:57
Steps to install Letsencrypt
@sampaiodiego
sampaiodiego / Dockerfile
Last active May 21, 2021 18:54
Rocket.Chat build and Docker image creation
FROM node:0.10
ADD . /app
RUN set -x \
&& cd /app/bundle/programs/server/ \
&& npm install \
&& npm cache clear
WORKDIR /app/bundle
@sampaiodiego
sampaiodiego / docker-compose.yml
Created August 29, 2016 14:26
reverse proxies test
---
version: '2'
services:
traefik:
image: traefik
#command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
command: --web --docker --docker.domain=docker.localhost
ports:
- "7000:80"
@sampaiodiego
sampaiodiego / docker-compose.yml
Last active August 29, 2016 16:18
reverse proxies test
---
version: '2'
services:
traefik:
image: traefik
command: --web --docker --docker.domain=docker.localhost
ports:
- "7000:80"
- "8080:8080"

Keybase proof

I hereby claim:

  • I am sampaiodiego on github.
  • I am chinello (https://keybase.io/chinello) on keybase.
  • I have a public key ASBHWQdxxkNtAZ4f3wJDl4J0hqeTva1Xemvx6nfd84z5KAo

To claim this, I am signing this object:

const fs = require('fs');
const { exec } = require('child_process');
const file = fs.readFileSync('replicasets4.txt').toString();
// const file = fs.readFileSync('pods.txt').toString();
(async () => {
const lines = file.split('\n');
const total = lines.length;