Skip to content

Instantly share code, notes, and snippets.

@wqweto
wqweto / program.cs
Last active August 1, 2023 08:31
Minimal .Net Web Server with Regex Routing in 177 LOC of C#
//
// Poor Man's Web Server with Regex Routing in 177 LOC of C#
//
// This is a simple standalone http server that handles routing with regular expressions
// matching. For each request the router passes capture groups to handlers as a data dictionary.
//
// Router implementation constructs a single composite regex to match request path, based on
// https://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html
//
// One can use `WebServer` and `Router` classes alone, just has to register all custom
@cruftlord
cruftlord / Subfolder to git repo.md
Last active April 26, 2024 03:37 — forked from korya/Subfolder to git repo.md
Convert subfolder into Git submodule
@rhelmer
rhelmer / gist:ce2354e7c11eb2848c2e
Last active November 24, 2016 10:16
Socorro Webapp

Running the Crash-Stats Web UI

If you have Socorro Lite installed (https://gist.github.com/rhelmer/1475ac173362edefa469), this guide will show you how to install the crash reporting web UI Crash-Stats that powers https://crash-stats.mozilla.com

The Django application uses both PostgreSQL and ElasticSearch (and supports Filesystem or S3 for pulling up crashes directly), so make sure to run the processor with all three crash storage classes configured (and set up per the Socorro Lite install doc):

@rhelmer
rhelmer / gist:1475ac173362edefa469
Last active November 24, 2016 10:16
Socorro Lite

Socorro (Lite)

  1. Create a place to hold crashes
mkdir crashreports
cd crashreports
  1. Build stackwalker
@soarez
soarez / ca.md
Last active April 22, 2024 03:01
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@pkrnjevic
pkrnjevic / inotify-example.cpp
Last active February 28, 2023 13:30
This simple inotify sample monitors changes to "./tmp". Recursive monitoring of file and directory create and delete events is implemented, but monitoring pre-existing "./tmp" subfolders is not. A C++ class containing a couple of maps is used to simplify monitoring. The Watch class is minimally integrated, so as to leave the main inotify code ea…
//
// File: inotify-example.cpp
// Date: July 16, 2013
// Author: Peter Krnjevic <pkrnjevic@gmail.com>, on the shoulders of many others
//
// This is a simple inotify sample program monitoring changes to "./tmp" directory (create ./tmp beforehand)
// Recursive monitoring of file and directory create and delete events is implemented, but
// monitoring pre-existing "./tmp" subfolders is not.
// A C++ class containing a couple of maps is used to simplify monitoring.
// The Watch class is minimally integrated, so as to leave the main inotify code