Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Html;
using Newtonsoft.Json;
namespace HtmlHelpers
{
/// <summary>
@aeris
aeris / privacy.sieve
Last active March 6, 2017 19:49
Sieve filter for privacy
# Licence : AGPLv3+
# rule:[Privacy]
if anyof (
address :is :domain "From" "gmail.com",
address :is :domain "From" "live.com",
address :is :domain "From" "msn.com",
address :is :domain "From" "hotmail.com",
address :is :domain "From" "hotmail.fr",
address :is :domain "From" "yahoo.com",
address :is :domain "From" "yahoo.fr"
@hardware
hardware / main.cf
Last active July 26, 2020 16:24
/etc/postfix/main.cf - Fichier de configuration de Postfix
#######################
## GENERALS SETTINGS ##
#######################
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
delay_warning_time = 4h
mailbox_command = procmail -a "$EXTENSION"
@barryo
barryo / dovecot-10-auth.conf
Last active October 24, 2023 14:29
Configuration Files for ViMbAdmin on Ubuntu 13.10 with Dovecot and Postfix - referenced from https://github.com/opensolutions/ViMbAdmin3/wiki/Mail-System-Install-on-Ubuntu
auth_mechanisms = plain login
!include auth-sql.conf.ext
@plentz
plentz / nginx.conf
Last active April 18, 2024 12:42
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@Thermionix
Thermionix / auth-basic.conf
Last active November 4, 2021 00:56
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@mikeygee
mikeygee / 01-before.html
Created May 7, 2012 07:45
truncate blog posts in jekyll
<!-- using the truncate filter -->
{% for post in site.posts limit:10 %}
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<span class="post-date">{{ post.date | date: "%B %d, %Y" }}</span>
{% if post.content.size > 2000 %}
{{ post.content | truncatewords: 300 }} <!-- bad! content gives you rendered html and you will truncate in the middle of a node -->
<a href="{{ post.url }}">read more</a>
{% else %}
{{ post.content }}
{% endif %}
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@mtigas
mtigas / gist:952344
Last active April 3, 2024 07:57
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes: