Skip to content

Instantly share code, notes, and snippets.

View tkarpinski's full-sized avatar

Tod Karpinski tkarpinski

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0 0 0 1</string>
@tkarpinski
tkarpinski / dfdexample.js
Created June 27, 2011 15:15
a sample ajax chunk request using deferreds
var getAllObjects = function () {
var start = 0,
chunkSize = 2000,
dfd = $.Deferred(),
getChunk = function (start, chunkSize) {
return $.ajax({
url: '<requesturi>',
type: 'POST',
dataType: 'json',
data: JSON.stringify({ start: start, length: chunkSize }),
@tkarpinski
tkarpinski / gist:1105014
Created July 25, 2011 19:49
powershell profile script
#copy this file to C:\users\<username>\Documents\WindowsPowerShell
#clone posh-git to C:\users\<username>\projects https://github.com/dahlbyk/posh-git.git
# Load posh-git example profile
. C:\users\<username>\projects\posh-git\profile.example.ps1
#Set environment variables for Visual Studio Command Prompt
pushd 'c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC'
cmd /c "vcvarsall.bat&set" |
foreach {
@tkarpinski
tkarpinski / template.js
Created January 4, 2012 18:11
template for js file using jslint and jquery namespace
/// <reference path="jquery-1.7.1.js"/>
/// <reference path="jquery.namespace.js"/>
/*globals jQuery, window, document*/
///<summary>
///template for new js file in visual studio and jslint
///</summary>
jQuery.namespace('my.namespace');
my.namespace = (function () {
'use strict';
@tkarpinski
tkarpinski / EnableLinkedConnections.reg
Created January 5, 2012 16:47
A reg file to EnableLinkedConnections (Network Drives over UAC) http://support.microsoft.com/kb/937624
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"EnableLinkedConnections"=dword:00000001
@tkarpinski
tkarpinski / web.config
Created January 16, 2012 14:43
webconfig for http to https redirect
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
@tkarpinski
tkarpinski / gist:1649302
Created January 20, 2012 20:04
Return JsonResult from Exception on Controller
protected override void OnException(ExceptionContext filterContext)
{
filterContext.Result = Json(new { error = filterContext.Exception.ToString()},JsonRequestBehavior.AllowGet());
}
@tkarpinski
tkarpinski / CasseteConfiguration.cs
Created February 10, 2012 16:45
Cassette / SignalR integration
public class CassetteConfiguration : ICassetteConfiguration
{
public void Configure(BundleCollection bundles, CassetteSettings settings)
{
//Assuming that you've included the SignalR.Js nuget package this is how you configure
//cassette to correctly order your Scripts and your hub script generated by signalr
bundles.AddPerSubDirectory<ScriptBundle>("Scripts");
bundles.AddUrlWithAlias<ScriptBundle>("http://localhost:50436/signalr/hubs", "signalr-hub", b => { b.AddReference("~/Scripts"); });
}
}
@tkarpinski
tkarpinski / github_issues_to_csv.rb
Created April 12, 2012 18:09 — forked from henare/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="USER_NAME"
PASSWORD="SEKRIT"
# Project you want to export issues from
USER="REPO_OWNER"
PROJECT="REPO_NAME"
@tkarpinski
tkarpinski / 1025charstring.txt
Created March 16, 2013 13:59
1025 char string - starts with 1, ends with 3, should exclude 3 if truncated at 1024 chars long
1aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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