Skip to content

Instantly share code, notes, and snippets.

View zeriss's full-sized avatar
:octocat:

Yoann Aubry zeriss

:octocat:
View GitHub Profile
@ataube
ataube / transaction.js
Created August 14, 2016 20:25
Loopback async/await transaction example
const Transaction = require('loopback-datasource-juggler');
const update = async (ids, delta) => {
const result = [];
const tx = await models.MyModel.beginTransaction({ isolationLevel: Transaction.READ_COMMITTED });
try {
for (const id of ids) {
const entity = await updateById(id, delta, { transaction: tx });
result.push(entity);
}
@kiview
kiview / description.md
Last active March 1, 2024 15:28
rocket.chat with docker-compose

Rocket.Chat Over HTTPS with Docker Compose

Instructions about how to setup a Rocket.Chat server including a HTTPS reverse proxy with docker-compose.

docker-compose.yaml

mongo:
  image: mongo
@anaisbetts
anaisbetts / slack-login.html
Created October 26, 2015 05:26
RxJS + Polymer
<dom-module id="slack-login">
<style>
:host {
display: block;
}
#card {
min-width: 500px;
}
@bitmage
bitmage / afterCreate.js
Last active February 16, 2017 01:01
Loopback Model - afterCreate hook to auto-save related models instantiated using build()
var async = require('async');
Project.afterCreate = function(done) {
var self = this;
function createRelation(rel, next, name) {
self[name].create(rel, next);
};
objMapAsync(this.__cachedRelations, createRelation, done);
@chrisallenlane
chrisallenlane / nginx.conf
Last active March 14, 2020 16:57
This is an nginx configuration that does the following: - Implements a RESTful API using CORS between `example.com` and `api.example.com` - Uses SSL - Reverse-proxies SSL traffic from port 443 to a NodeJS application running on port 8000 Adapted from this page, with thanks to the original author: http://enable-cors.org/server_nginx.html
# Configure the reverse-proxy on port 443
server {
# general configs
keepalive_timeout 30;
listen 127.0.0.1:443 ssl;
server_name api.example.com;
# ssl configs
ssl_certificate /path/to/api.crt;
ssl_certificate_key /path/to/api.key;