This file contains hidden or 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 SearchParameter | |
{ | |
public string VariableName { get; set; } | |
public string WhereClause { get; set; } | |
public bool IsWildcardSearch { get; set; } | |
public bool IsRangeSearch { get; set; } | |
public bool AllowsMultipleValues { get; set; } | |
public Type ParameterType { get; set; } | |
} |
This file contains hidden or 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
// All site search criteria in a dictionary for easy lookup/manipulation | |
// when dynamically building the query. | |
public static Dictionary<string, SearchParameter> GetSearchCriteria() | |
{ | |
var results = new Dictionary<string, SearchParameter> | |
{ | |
{ | |
"SiteID", new SearchParameter | |
{ | |
VariableName = "site_uid", |
This file contains hidden or 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 static ObjectQuery<T> BuildObjectQuery<T> | |
(ObjectQuery<T> query, NameValueCollection parameters, | |
Dictionary<string, SearchParameter> searchCriteria) | |
{ | |
var results = query; | |
// If there are parameters in our collection, build a where clause | |
// using the search criteria dictionary. Otherwise the method ends | |
// and the query remains the same. | |
if (parameters.Count > 0) |
This file contains hidden or 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
SELECT COUNT(application_id) as duplicate_count, | |
application_id, | |
lock_version, | |
asset_id, | |
customer_id, | |
received_date, | |
fee_amount, | |
created_at, | |
updated_at |
This file contains hidden or 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
-- Algorithm -- | |
-- 1. Run query to get all duplicate count values. Since we're getting cloned | |
-- rows, we can run the query based off of all fields in the table. Store | |
-- in table variable. | |
-- | |
-- 2. Iterate through table. | |
-- | |
-- 2a. Use DELETE TOP(x - 1) remove all duplicates. | |
-- | |
-- 3. Done |
This file contains hidden or 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
DELETE application_versions FROM | |
( | |
SELECT TOP (@duplicate_count - 1) id | |
FROM application_versions | |
WHERE (@application_id IS NULL OR application_id = @application_id) | |
AND (@lock_version IS NULL OR lock_version = @lock_version) | |
AND (@asset_id IS NULL OR asset_id = @asset_id) | |
AND (@customer_id IS NULL OR customer_id = @customer_id) |
This file contains hidden or 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
AppLogin.Focus(); | |
this.Form.DefaultButton = "ctl00$BodyPlaceHolder$AppLogin$LoginButton"; |
This file contains hidden or 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
Get-ChildItem | Where-Object {-Not $_.PsIscontainer -AND $_.name -match "\s"} | | |
foreach { | |
$fixedname = $_.name.Replace(' ','_'); | |
iex "svn rename '$_' $fixedname" | |
} |
This file contains hidden or 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
try | |
mount volume "smb://readyshare/MacBackup" | |
end try | |
do shell script "hdiutil attach -mountpoint /Volumes/MacBackup/ /Volumes/MacBackup/TimeMachine.sparsebundle" |
This file contains hidden or 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
#!/usr/bin/env python | |
# | |
# file: isgovtdown.py | |
# | |
# description: checks usa.gov for the "Government has shut down" message | |
# Forked from https://gist.github.com/eduardkoller/6784503 | |
# and modified to work with Python 2.7 | |
# | |
# usage: ./isgovtdown.py | |
# |