Skip to content

Instantly share code, notes, and snippets.

@voidfiles
voidfiles / index.json
Created May 19, 2017 22:08
Hugo JSON Feed Template add to layouts/index.json
{
"version": "https://jsonfeed.org/version/1",
"title": {{ .Site.Title | jsonify }},
"home_page_url": {{ .Permalink | jsonify }},
{{ with .OutputFormats.Get "json" -}}
"feed_url": {{ .Permalink | jsonify }},
{{- end }}
{{ if (.Site.Params.author) or (.Site.Params.author_url) -}}
"author": {
{{ if .Site.Params.author -}}
@bernardoVale
bernardoVale / docker-compose.yml
Last active April 24, 2019 21:02
Traefik with ssl
version: '2'
services:
traefik:
image: traefik
command: -c /dev/null --web --docker --docker.domain=docker.localhost --logLevel=DEBUG --entryPoints="Name:https Address::443 TLS:/certs/server.crt,/certs/server.key;/certs_br/server.crt,/certs_br/server.key" --entryPoints="Name:http Address::80 Redirect.EntryPoint:https"
ports:
- "80:80"
- "8080:8080"
@wader
wader / docker-compose-traefik.yml
Last active January 15, 2019 03:12
traefik, docker, let's encrypt, http to https redirect
version: '2'
services:
traefik:
restart: unless-stopped
image: traefik
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
package cmd
import (
"strings"
"github.com/chzyer/readline"
"github.com/spf13/cobra"
)
var shellCmd = &cobra.Command{
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@rrafal
rrafal / sqlx_json.go
Created March 31, 2016 00:02
Use JSON field with golang sqlx driver
package main
import (
"encoding/json"
"errors"
"database/sql/driver"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/lib/pq"
"log"
@Darkside73
Darkside73 / webpack.server.js
Created January 14, 2016 08:22
Webpack dev server with hot reload
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../webpack.config');
const hotWebpackPort = process.env.HOT_WEBPACK_PORT || 3500;
config.output.publicPath = `https://localhost:${hotWebpackPort}/assets/`;
['entry1', 'entry2'].forEach(entryName => {
config.entry[entryName].push(
'webpack-dev-server/client?https://localhost:' + hotWebpackPort,
'webpack/hot/only-dev-server'
@husobee
husobee / validation-main.go
Created January 8, 2016 20:07
input validation sanely
package main
import (
"encoding/json"
"errors"
"net/http"
"github.com/asaskevich/govalidator"
)
@Lissy93
Lissy93 / gulpfile.js
Last active April 2, 2018 08:15
An over-commented example of a Gulp setup for Express Node apps, with live reload from browser-sync and nodemon as well as a complete build setup using various modules
/**
* Created by alicia.sykes on 17/07/2015.
* To run script run "gulp" in the command line
* To just watch files run "gulp watch"
* To just clean the public directory run "gulp clean"
*/
/* Include the necessary modules */
var gulp = require('gulp');
var gutil = require('gulp-util'); // For logging stats and warnings
@woloski
woloski / multitenant.md
Last active February 11, 2024 23:14
Multi Tenant Apps in Auth0

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client-organizations (tenants)

Let's start by enumerating some multi tenant applications and understand how they handle it.

Slack

Authentication: