Skip to content

Instantly share code, notes, and snippets.

@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active May 4, 2024 16:50
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@NickCraver
NickCraver / DapperExample.cs
Last active February 21, 2016 20:53
Query Optimization: Literal Example
// Here's a normal query as you'd expect
db.QuerySingleOrDefault<PostCacheEntry>(@"SELECT
(Select Count(*) From Posts Where PostTypeId = @Question And DeletionDate Is Null) TotalQuestions,
(Select Count(*) From Posts Where PostTypeId = @Question And IsNull(IsAnswered, 0) = 0 And AcceptedAnswerId Is Null And ClosedDate Is Null And DeletionDate Is Null) TotalUnanswered,
(Select Count(*) From Posts Where PostTypeId = @Question And AcceptedAnswerId Is Not NulL And DeletionDate Is Null) TotalAccepted,
(Select Count(*) From Posts Where PostTypeId = @Answer And DeletionDate Is Null) TotalAnswers",
new { PostTypeId.Question, PostTypeId.Answer });
// In this case though, PostTypeId.Question and PostTypeId.Answer are values that never change.
// In this case they're constants, but this same trick works for enums.
@winhamwr
winhamwr / tutorial.md
Created June 4, 2012 22:37
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham winhamwr@gmail.com

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.