This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Use this AutoHotKey script to launch Console2 with the working directory set to the directory you have open in Windows Explorer. | |
;Think "open command window here" | |
;Shortcut is CTRL+ALT+H | |
#IfWinActive ahk_class CabinetWClass ; for use in explorer. | |
;Open command window here | |
^!h:: | |
Sleep 100 | |
ClipSaved := ClipboardAll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Test()> | |
public sub Test_getting_by_Type | |
Dim newTypeInstance As Type = GetType(ModelBinder.ModelBinder(Of Models.Query.Query)) | |
'Fails...why? | |
Dim retrievedByType = ObjectFactory.GetInstance(newTypeInstance)() | |
retrievedByType.ShouldNotBeNull() | |
'Passes | |
Dim retrievedByExplicit = ObjectFactory.GetInstance(Of ModelBinder.ModelBinder(Of Models.Query.Query))() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery-1.4.2.js"></script> | |
<script type="text/javascript"> | |
$().ready(function() { | |
var options = $("select").find("option").get(); | |
var dupesRemoved = $.unique(options); | |
//This pops up a deuce... any idea why? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
balsamiq = 'C:/Program Files (x86)/Balsamiq Mockups/Balsamiq Mockups.exe' | |
mockup_directory = 'C:/Mockups' | |
output_directory = 'C:/Mockups/Images' | |
require 'find' | |
files = Array.new | |
Find.find(mockup_directory) do |f| | |
if /.bmml$/.match(f) | |
files << f | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function GetById(ByVal id As Integer) As T Implements IDataLayer(Of T).GetById | |
Dim entityType As Type = GetType(T) | |
Dim entityTypeName As String = entityType.ToString | |
Dim keyProperty As String = entityTypeName.Substring(entityTypeName.LastIndexOf(".") + 1) + "Id" | |
Dim container = Context.MetadataWorkspace.GetEntityContainer(Context.DefaultContainerName, Metadata.Edm.DataSpace.CSpace) | |
Dim entitySetName As String = (From meta In container.BaseEntitySets _ | |
Where meta.ElementType.Name = entityType.Name _ | |
Select meta.Name).First() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Compare_To_VB_Object_Weirdness | |
{ | |
[Test] | |
public void Something() | |
{ | |
var someObject = new Object(); | |
someObject = new DoStuff(); | |
//This does not compile, as expected | |
int result = someObject.GiveMeAnInteger(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class CrazyVBTypingTests | |
<Test()> | |
Public Sub Test_crazy_crap() | |
Dim anObject As New Object | |
anObject = New DoStuff | |
'This compiles, WTH? | |
Dim someInteger As Integer = anObject.GiveMeAnInteger() | |
someInteger.ShouldEqual(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Class CrazyVBTypingTests | |
<Test()> | |
Public Sub Test_crazy_crap() | |
Dim anObject As New Object | |
anObject = New DoStuff | |
'This compiles, WTH? | |
Dim someInteger As Integer = anObject.GiveMeAnInteger() | |
someInteger.ShouldEqual(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE [dbo].[Job]( | |
[JobId] [int] IDENTITY(1,1) NOT NULL, | |
etc... | |
--One or more Splits per Job | |
CREATE TABLE [dbo].[Split]( | |
[SplitId] [int] IDENTITY(1,1) NOT NULL, | |
[JobId] [int] NOT NULL, | |
etc... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//PassParametersDuringRedirectAttribute.cs | |
// ~Line 25 | |
public override void OnActionExecuting(ActionExecutingContext filterContext) | |
{ | |
base.OnActionExecuting(filterContext); | |
//Fair to say you'd only want this behavior on a GET request? | |
//I did this because it was hijacking properties on my model that was populated by a model binder. | |
if(filterContext.RequestContext.HttpContext.Request.HttpMethod == "GET") |