Skip to content

Instantly share code, notes, and snippets.

View bsimser's full-sized avatar
💭
Waiting for the zombie apocalypse to start

Occular Malice bsimser

💭
Waiting for the zombie apocalypse to start
View GitHub Profile
@bsimser
bsimser / SentenceParser.cs
Created January 12, 2012 19:56
Blatently stolen from somewhere, just beautiful code that I wanted to copy and use at some point
namespace System
{
public static class SentenceParser
{
public static string TrimSentence(this string @string, int length)
{
if (TheInputsAreNotValid(length, @string)) return AnEmptyString();
if (TheLengthIsLongerThanTheInputString(length, @string)) return TheOriginalString(@string);
if (TheNextCharacterIsEmpty(@string, length)) return TheNormallyParsedString(length, @string);
@bsimser
bsimser / redis.conf
Created August 28, 2010 23:29
Redis configuration file for gemcutter
# Redis configuration file for gemcutter
# Note on units: when memory size is needed, it is possible to specifiy
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
@bsimser
bsimser / redis.sh
Created August 28, 2010 17:49
redis server for gemcutter install
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db