Skip to content

Instantly share code, notes, and snippets.

View brilligence's full-sized avatar

Murali Rajendran brilligence

View GitHub Profile
# Varnish Configuration
START=yes
NFILES=131072
MEMLOCK=82000
DAEMON_OPTS="-a :80 \
-T localhost:6082 \
-f /etc/varnish/default.vcl \
-S /etc/varnish/secret \
-t 120 \
@brilligence
brilligence / WP_AutoPluginInstall.php
Last active December 14, 2015 13:18
WP_AutoPluginInstall
define ('FS_METHOD', 'direct'); // for automatic plugin installation
/* That's all, stop editing! Happy blogging. */
@brilligence
brilligence / gist:5167373
Created March 15, 2013 03:54
Varnish VCL Configuration
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 60s;
.first_byte_timeout = 60s;
.between_bytes_timeout = 60s;
.max_connections = 800;
}
acl purge {
@brilligence
brilligence / gist:5207191
Last active December 15, 2015 05:09
Using LINQ to find duplicates (List extension)
/// <summary>
/// Method that returns all the duplicates in the collection.
/// </summary>
/// <typeparam name="T">The type.</typeparam>
/// <param name="list">The Original List to detect for duplicates.</param>
/// <returns>A list of duplicates found in the Original List.</returns>
public static List<T> GetDuplicates<T>(this List<T> list)
{
// Finding duplicates by Grouping the entries and then finding
// Groups that have more than one entity
internal class Program
{
// Sample unordered list of strings
private const string OriginalString = "[V],[E],[B],[B],[O],[E],[P],[B]";
private static void Main(string[] args)
{
var lst = new List<string>();
lst.AddRange(OriginalString.Split(','));