Skip to content

Instantly share code, notes, and snippets.

View ksummerlin's full-sized avatar

Kelly Summerlin ksummerlin

View GitHub Profile
@ksummerlin
ksummerlin / wordpress.conf
Created October 25, 2013 19:31
Ubuntu 13.10, Apache 2.4 wordpress.conf for a WordPress blog sub-directory.
Alias /wordpress/wp-content /var/lib/wordpress/wp-content/
Alias /wordpress /usr/share/wordpress/
<Directory "/usr/share/wordpress">
Options FollowSymLinks MultiViews
</Directory>
<Directory "/var/lib/wordpress">
Options Includes FollowSymLinks MultiViews
@ksummerlin
ksummerlin / gist:5503457
Last active December 16, 2015 21:59
Using third-party libraries in TypeScript with ambient declarations.
/// <reference path="../Scripts/typings/jquery/jquery.d.ts" />
$('a').click(function () {
alert('clicked');
});
@ksummerlin
ksummerlin / gist:5495776
Last active December 16, 2015 20:50
One option is to define a static function that automatically executes using the 'fat arrow syntax'.
class Foo {
static baseTime: Date;
private static Ctor = (() =>
{
Foo.baseTime = new Date();
Foo.baseTime.setMilliseconds(0);
return null;
})();
}
@ksummerlin
ksummerlin / illegal_static_constructor
Created May 1, 2013 14:50
The concept of a static constructor does not exist in the TypeScript language (as of v0.8.3)
class Foo {
static baseTime: Date;
static constructor() {
Foo.baseTime = new Date();
Foo.baseTime.setMilliseconds(0);
}
}
@ksummerlin
ksummerlin / git-svn-diff.sh
Created July 26, 2012 19:19 — forked from nmacinnis/git-svn-diff.sh
Windows and TortoiseSVN-friendly modifications
#!/bin/bash
#
# git-svn-diff originally by (http://mojodna.net/2009/02/24/my-work-git-workflow.html)
# modified by mike@mikepearce.net
# modified by aconway@[redacted] - handle diffs that introduce new files
#
# Generate an SVN-compatible diff against the tip of the tracking branch
# Get the tracking branch (if we're on a branch)
TRACKING_BRANCH=`git svn info | grep URL | sed -e 's/.*\/branches\///'`
--@max_other_orders is a parameter to stored proc
select top (@max_other_orders)
OH.SalesOrderID,
OH.CustomerId,
OH.SalesOrderNumber,
OH.Status,
count(*) over(partition by OH.CustomerId) as OtherOrdersCount
from Sales.SalesOrderHeader OH
where
OH.CustomerID = @customer_id
void FillOtherOrdersSection(int maxOtherOrders) {
GetOtherOrders(maxOtherOrders); //Calls stored procedure to fill _otherOrders
foreach (var otherOrder in _otherOrders) {
if (string.IsNullOrEmpty(otherOrder.Status)) {
status = "";
} else {
status = " - " + otherOrder.Status;
}
MakeOrderLink(otherOrder);
}
void FillOtherOrdersSection() {
GetOtherOrders(); //Calls stored procedure to fill _otherOrders
foreach (var otherOrder in _otherOrders) {
if (string.IsNullOrEmpty(otherOrder.Status)) {
status = "";
} else {
status = " - " + otherOrder.Status;
}
MakeOrderLink(otherOrder);
}
select top 3
OH.SalesOrderID,
OH.CustomerId,
OH.SalesOrderNumber,
OH.Status
from Sales.SalesOrderHeader OH
where
OH.CustomerID = @customer_id
and OH.SalesOrderID <> @current_sales_id
order by OH.OrderDate
@ksummerlin
ksummerlin / CustomerProgramsPageObject.cs
Created May 4, 2012 03:18
Example SlowLoadableComponent page object
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using OpenQA.Selenium;
using OpenQA.Selenium.Support.PageObjects;
using OpenQA.Selenium.Support.UI;
using Selenium.ExtJs.Support.Locators;