Format:
Recent snippets for: David R. Longnecker
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> - <System> <Provider Name="Windows Error Reporting" /> <EventID Qualifiers="0">1001</EventID> <Level>4</Level> <Task>0</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2010-02-11T02:06:35.000000000Z" /> <EventRecordID>3305</EventRecordID> <Channel>Application</Channel>
34 Views
no comments
<var columnClass="new [] {'span-11 column', 'span-11 column last' }" /> <div each="var item in o.Items" columnClass="${lastClass[itemIndex%2]}"> </div>
62 Views
no comments
Original HTML+BluePrintCSS <div id="header" class="container"> <div id="title" class="span-10"> <h1>${H(ApplicationName)}</h1> </div> <div id="logindisplay" class="prepend-8 span-6 last"> <logOnUserControl /> </div> <div id="menucontainer" class="span-24 last">
54 Views
no comments
#header { #title { .span-10, .column; } #logindisplay { .prepend-8, .span-6, .column, .last; text-align: right; }
78 Views
4 comments
param ([string] $filename) function splitString([string]$string, [int]$length) { $lines = @(); $stringLength = $string.Length; $position = 0; while ($position -lt $stringLength) {
172 Views
no comments
$path = resolve-path . $rand = New-Object system.random $port = $rand.next(2048,10240) $path_to_devserver = "C:\\Program Files (x86)\\Common Files\\microsoft shared\\DevServer\\9.0\\Webdev.WebServer.exe" & $path_to_devserver /port:$port /path:$path (new-object -com shell.application).ShellExecute("http:\\localhost:$port")
170 Views
no comments
properties {
# **************** CONFIGURE ****************
$solution_name = "Framework"
$test_library = "$solution_name.Test.dll"
$libraries_to_merge = "antlr3.runtime.dll", `
"ajaxcontroltoolkit.dll", `
"Castle.DynamicProxy2.dll", `
"Castle.Core.dll", `
184 Views
no comments
using System; using System.Collections.Generic; using FluentNHibernate.Automapping; using FluentNHibernate.Cfg; using FluentNHibernate.Cfg.Db; using NHibernate; using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; using Xunit;
72 Views
no comments
param ( [string]$server = ".", [string]$instance = $(throw "a database name is required"), [string]$query ) [System.Reflection.Assembly]::LoadWithPartialName("System.Data.OracleClient") | out-null $connection = new-object system.data.oracleclient.oracleconnection( ` "Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$server)(PORT=1521)) ` (CONNECT_DATA=(SERVICE_NAME=$instance)));User Id=USER_ID;Password=PASSWORD;");
383 Views
no comments
param ( [string]$server = ".", [string]$instance = $(throw "a database name is required"), [string]$query ) $connection = new-object system.data.sqlclient.sqlconnection( ` "Data Source=$server;Initial Catalog=$instance;Integrated Security=SSPI;"); $adapter = new-object system.data.sqlclient.sqldataadapter ($query, $connection)
298 Views
2 comments
param ([string]$computerName = (gc env:computername)) function GetExceptionType($type, $logEvent) { if ($type -ne "Error") { $logEvent.ReplacementStrings[17] } else { $rx = [regex]"Exception:.([0-9a-zA-Z].+)" $matches = $rx.match($logEvent.ReplacementStrings[0]) $matches.Groups[1].Value }
175 Views
no comments
function truncate-string([string]$value, [int]$length) { if ($value.Length -gt $length) { $value.Substring(0, $length) } else { $value } }
265 Views
no comments
param ( $fileToImport = $(throw "must have a file to import!") ) $from = "myemail@domain.com" $smtpServer = "smtp.server" $logoName = "d:\path_to_embedded_File\logo.jpg" #Import-Csv $fileToImport | # select to, htmlContent, AttachmentFileName |
115 Views
no comments
function ReadyEnvironment ( [string]$sharedDrive, [string]$userName, [string]$computerName) { set-variable tools "$sharedDrive\shared_tools" -scope 1 set-variable scripts "$sharedDrive\shared_scripts" -scope 1 set-variable rdpDirectory "$sharedDrive\shared_tools\RDP" -scope 1 set-variable desktop "C:\Users\$userName\DESKTOP" -scope 1 Write-Host "Setting environment for $computerName" -foregroundcolor cyan
364 Views
no comments
public class ComponentPropertyConvention : IPropertyConvention, IPropertyConventionAcceptance { public void Accept(IAcceptanceCriteria<IPropertyInspector> criteria) { criteria.Expect(x => x.EntityType.IsAny(typeof (IndividualInfo), typeof (CompanyInfo), typeof (Address))); } public void Apply(IPropertyInstance instance) { var name = string.Format("{0}_{1}", instance.EntityType.Name, instance.Property.Name);
67 Views
no comments
[Precompile] public class WorkoutController : Controller { public ActionResult Index() { var workouts = new WorkoutRepository().GetAll(); ViewData["workouts"] = new WorkoutIndexViewModel().Render(workouts); return View(); }
66 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
