Skip to content

Instantly share code, notes, and snippets.

@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 / Install Lets Encrypt.md
Last active December 16, 2017 16:57
Steps to install Letsencrypt
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 / 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

@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;
/*
EXAMPLE MESSAGE
/poll "question?" "option 1" "option 2"
*/
/** Global Helpers
*
* console - A normal console instance
* _ - An underscore instance