Skip to content

Instantly share code, notes, and snippets.

View afrokick's full-sized avatar
🏠
Working from home

Alex Sosnovskiy afrokick

🏠
Working from home
View GitHub Profile
@afrokick
afrokick / docker-compose.yml
Created September 2, 2022 13:37
docker-compose for meteor app
version: '3'
services:
edik_1:
restart: always
image: "${IMAGE}:${TAG}"
hostname: "${HOSTNAME}_1"
env_file:
- ./config.env
user: root
mem_limit: 4g
@afrokick
afrokick / Dockerfile
Created September 2, 2022 13:34
Docker file for Meteor
FROM node:14.19.1-stretch-slim as base
ENV APP_DIR=/meteor
# Install as root (otherwise node-gyp gets compiled as nobody)
USER root
WORKDIR $APP_DIR/bundle/programs/server/
RUN apt-get update \
&& apt-get install -y --no-install-recommends g++ build-essential python \
&& apt-get clean \
@afrokick
afrokick / example.js
Last active August 3, 2019 19:29
Example of PeerJS DataConnection
/* global Peer */
document.addEventListener('DOMContentLoaded', () => {
initiator();
another();
}, false);
// initiator side
const initiator = () => {
const peer = new Peer('initiatorId', { debug: 3 });
import {EventBus} from "./eventBus";
const sdk = VoxImplant.getInstance();
// assign handlers
sdk.on(VoxImplant.Events.ConnectionEstablished, onConnectionEstablished);
sdk.on(VoxImplant.Events.ConnectionFailed, onConnectionFailed);
sdk.on(VoxImplant.Events.ConnectionClosed, onConnectionClosed);
sdk.on(VoxImplant.Events.AuthResult, onAuthResult);
sdk.on(VoxImplant.Events.IncomingCall, onIncomingCall);
@afrokick
afrokick / [Ubuntu] Install nginx + letsencrypt
Last active March 13, 2019 15:00
It is a list of commands for install nginx + Letsencrypt
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
sudo apt-get install -y nginx && sudo apt-get install -y software-properties-common && sudo apt-get install -y python-certbot-nginx
sudo certbot --nginx
@afrokick
afrokick / nginx-meteor-default
Created September 5, 2018 17:24
nginx configuration for meteor proxy
upstream meteor {
hash $remote_addr;
server app1.example.com:3000 max_fails=2 fail_timeout=5s;
server app2.example.com:3000 max_fails=2 fail_timeout=5s;
}
server {
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
public static string ConvertPathToUrl(string path)
{
string url;
if (path.StartsWith("/"))
{
url = "file://" + path;
}
else if (path.StartsWith("file:///"))
{
url = path;