Skip to content

Instantly share code, notes, and snippets.

View BanjoFox's full-sized avatar

Banjo Fox BanjoFox

View GitHub Profile
@wezm
wezm / activitypub.rs
Last active December 21, 2017 14:17
An attempt at representing ActivityPub in Rust
use std::collections::HashMap;
use serde::ser::{Serialize, SerializeStruct};
#[derive(Default)]
pub struct Object {
pub context: Context,
pub id: String,
// type to be defined by sub-type? Or have a big enum for it?
pub attachment: Option<String>,
@simonhaenisch
simonhaenisch / nginx-config.md
Last active February 8, 2023 01:20
Nginx configuration boilerplate with SSL

Nginx Configuration Boilerplate

This is my boilerplate for a Nginx config with SSL. I like the idea of modular includes, so I created a /etc/nginx/includes directory for files that get included into the main config file /etc/nginx/nginx.conf. I moved mime.types and fastcgi.conf to that includes folder. I use a common-location-rules.conf file for location rules that are shared between all sites hosted on the server. Relative paths in include directives are relative to the config prefix path (path to the nginx.conf file, by default /etc/nginx/).

The following files are from h5bp/server-configs-nginx:

  • includes/mime.types: here the correct MIME type for javascript (application/javascript instead of text/javascript) is set among others. Using this file is important because the gzip_types rule is set accordingly in gzip.conf.
  • **[includes/expires.conf](htt