Skip to content

Instantly share code, notes, and snippets.

View torrybr's full-sized avatar
🌴
On vacation

torrybr

🌴
On vacation
View GitHub Profile
@gregoiredx
gregoiredx / default.conf.template
Last active May 18, 2025 13:30
Nginx configured as a third party internal gateway proxy with cache
# To be use with https://hub.docker.com/_/nginx or https://hub.docker.com/r/nginxinc/nginx-unprivileged
# COPY this file to /etc/nginx/templates/default.conf.template
# For env var substitution, see "Using environment variables in nginx configuration" at https://hub.docker.com/_/nginx
# Example values:
# environment:
# - CACHE_FILES_PATH=/mnt/cache
# - CACHE_FILES_MAX_SIZE=1g
# - CACHE_MEMORY_SIZE=10m
# - CACHE_VALID_TIME=1m
@diyfr
diyfr / docker-compose.yml
Last active December 12, 2024 08:29
Basic secured configuration for Traefik V2.X
version: '3.5'
services:
proxy:
image: traefik:v2.1
# The official v2.0 Traefik docker image
container_name: proxy
networks:
- traefik
ports:
@PARC6502
PARC6502 / OpenSourceBaas.md
Last active December 5, 2025 02:13
List of open source, self hosted BaaS - Backend as a service

Backend as a Service

Supabase - ~52K stars

  • Designed explicitly as an open source firebase alternative
  • Typescript based
  • Docker support

Appwrite - ~32K stars

  • Written in JavaScript and PHP
  • Docker based
  • Realtime support across all services
@marcopaganini
marcopaganini / nginx_reverse_proxy_with_ssl_cert_authentication.md
Last active June 2, 2025 02:19
NGINX reverse proxy with SSL cert authentication

NGINX reverse proxy with SSL cert authentication

This is a short guide for those who want to set up a NGINX reverse proxy with SSL cert authentication. The basic idea is to create a private CA and emit certificates signed by it. Only browsers and/or devices with the certs signed by this CA will be granted access to resources behind the proxy.

There are a few examples of similar configurations on the web, but most use openssl directly. This gist uses Easy-RSA to simplify the task of creating and maintaining a private CA and certs to be distributed to clients.

Install and configure Easy-RSA

Clone Easy-RSA 3:

@endpnt
endpnt / text_selection_with_childNodes.js
Created April 19, 2011 00:32
find actual text start and end position of a selected text, even with childNodes present.
var offset = 0;
var selection = window.getSelection();
var range = selection.getRangeAt(0);
var start = range.startOffset;
var end = range.endOffset;
if ( selection.baseNode.parentNode.hasChildNodes() ) {
for ( var i = 0 ; selection.baseNode.parentNode.childNodes.length > i ; i++ ) {
var cnode = selection.baseNode.parentNode.childNodes[i];
if (cnode.nodeType == document.TEXT_NODE) {