Skip to content

Instantly share code, notes, and snippets.

View actaneon's full-sized avatar

Josh King actaneon

  • Get Satisfaction
  • San Francisco, CA
View GitHub Profile
public string SplitPascalCase(string s)
{
return System.Text.RegularExpressions.Regex.Replace(s, "([a-z](?=[A-Z])|[A-Z](?=[A-Z][a-z]))", "$1 ");
}
@actaneon
actaneon / UniformBrowserTextSize.css
Created June 30, 2009 19:53
Uniform Browser Text Size
body {
font-size:100%;
line-height:1.125em; /* 16×1.125=18 */
}
.bodytext p {
font-size:0.875em;
}
.sidenote {
For /F "tokens=1*" %%a In ('date /T') Do Set Date=%%a %%b
REM MM/DD/YYYY
Set PrintDate=%Date:~4,10%
REM YYYYMMDD
Set FileDate=%Date:~10,4%%Date:~4,2%%Date:~7,2%
REM HH:MM:SS.MS
Set PrintTime=%Time%
@actaneon
actaneon / SQLDateConvert.txt
Created July 7, 2009 14:59
MSSQL Date Conversions
Fmt Standard Input/Output
------------------------------------------------
100 Default mon dd yyyy hh:mi(AM/PM)
101 US mm/dd/yyyy
108 - hh:mi:ss
112 ISO yymmdd
114 - hh:mi:ss:mmm
120 ODBC Canonical yyyy-mm-dd hh:mi:ss
121 ODBC Canonical yyyy-mm-dd hh:mi:ss.mmm
@actaneon
actaneon / JavascriptPrototype.html
Created July 8, 2009 20:23
Javascript Prototype Example
<html>
<body>
<span id="main" />
<script>
function Circle(radius) {
this.PI = 3.141592654;
this.radius = radius;
this.Diameter = function() {
@actaneon
actaneon / .gitignore
Created July 21, 2009 19:51
.gitignore
log
database.yml*
obj
bin
deploy
deploy/*
_ReSharper.*
*.csproj.user
*.vbproj.user
*.resharper.*
@actaneon
actaneon / DelimitedFileParser.cs
Created August 21, 2009 20:09
DelimitedFileParser.cs
using Microsoft.VisualBasic.FileIO;
public class DelmitedFileParser
{
private void Parse()
{
TextFieldParser parser = new TextFieldParser(@"c:\temp\test.csv");
parser.TextFieldType = FieldType.Delimited;
parser.SetDelimiters(",");
@actaneon
actaneon / .gitconfig
Created October 23, 2009 06:47
.gitconfig
[user]
email = actaneon@gmail.com
name = Josh King
[core]
excludesfile = /Users/jking/.gitignore
#excludesfile = c:/Users/jking/.gitignore
editor = vim
pager = less -FRSX
[merge]
tool = vimdiff
@actaneon
actaneon / Default.aspx
Created October 27, 2009 05:07
Default.aspx for ASP.NET MVC 2
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%
var originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
%>
@actaneon
actaneon / IFS.sh
Created November 18, 2009 02:36
IFS - Looping Over Space Separated Filenames
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *
do
echo "$f"
done
IFS=$SAVEIFS