Skip to content

Instantly share code, notes, and snippets.

View stimms's full-sized avatar
💭
Talking at #MSIgniteToronto

Simon Timms stimms

💭
Talking at #MSIgniteToronto
View GitHub Profile
@stimms
stimms / gist:1591002
Created January 10, 2012 20:29
Silly query
select PossibleA.SystemName,
PossibleA.SystemDescription,
PossibleA.SortOrder,
TotalA.TotalA,
TotalB.TotalB,
PossibleA.Buildings as PossibleABuildings,
PossibleA.EHT as PossibleAEHT,
PossibleA.Electrical as PossibleAElectrical,
@stimms
stimms / gist:2422966
Created April 19, 2012 18:51
Getting a connection
Public Function GetSQLServerConnection() As Connection
Dim con As Connection
Set con = New Connection
con.connectionString = CurrentDb.TableDefs(10).Connect
con.Open
Set GetSQLServerConnection = con
End Function
@stimms
stimms / gist:2423052
Created April 19, 2012 18:56
Function for commands
Public Function RunCommandAgainstSQLServer(cmd as Command)
command.ActiveDatabaseConnection = GetConnectionString 'also opens the connection
command.Execute
command.ActiveDatabaseConnection.Close
End Function
@stimms
stimms / gist:2595438
Created May 4, 2012 15:17
Playing with processing
<html>
<script src="processing.js"></script>
<script type="application/processing" data-processing-target="pjs">
int blobCount = 10;
GlowingBlob[] blobs = new GlowingBlob[blobCount];
void setup() {
size(500, 500);
background(100);
stroke(255);
@stimms
stimms / gist:4296677
Created December 15, 2012 16:07
D3.js rendering some circles
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var margin = {top: 20, right: 20, bottom: 30, left: 40},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
var formatPercent = d3.format(".0%");
var x = d3.scale.ordinal()
@stimms
stimms / gist:4320357
Created December 17, 2012 17:56
A token resolver
public class TagInformationResolver: IResolver
{
//The cache keeps track of the last n tags so we don't have to keep going to the database
//for data which isn't really changing
private static TagCache{get; set;}
public TagInformationResolver(ITagRepository tagRepository)
{//we could probably make the cache responsible for resolving its own information but that limits our ability
//to use dependency injection for different strategies.
TagCache.SetResolver(tagRepository);
public class TokenReplacementCheckSheetProcessor : BaseChecksheetDecorator, IChecksheetDecorator
{
//A list of all the token resolvers known to the container
public IEnumerable<ITokenResolver> Resolvers {get;set;}
//A cache of the tokens to replace in a single check sheet
//It is time consuming to search a word document for the
//tokens so we try to do it only once for each sort of checkseet
public ICheckSheetTokenCache CheckSheetTokenCache {get;set;}
<Import Project="$(MSBuildToolsPath)\Novell\Novell.MonoDroid.CSharp.targets" Condition = "Exists ('/Developer/MonoAndroid/License.rtf') And !Exist('/Developer/MonoTouch/License.rtf')"/>
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" Condition = "Exists ('/Developer/MonoAndroid/License.rtf') And !Exists ('/Developer/MonoTouch/License.rtf')"/>
<PropertyGroup Condition = "Exists ('/Developer/MonoAndroid/License.rtf') And !Exists ('/Developer/MonoTouch/License.rtf')">
<TargetFrameworkIdentifier>MonoAndroid</TargetFrameworkIdentifier>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>