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
using System; | |
using System.Collections.Generic; | |
namespace JoeSauve | |
{ | |
/// <summary> | |
/// Triggered queue. Provides events immediately before and after enqueueuing and dequeuing. | |
/// </summary> | |
public class TriggeredQueue<T> | |
{ |
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 MyClass | |
{ | |
private Object _Something; | |
public Object Something | |
{ | |
get { return _Something; } | |
set { _Something = value; } | |
} | |
public void MyMethod (object myParam) |
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
DECLARE @atdString NVARCHAR(50), @ariString NVARCHAR(50); | |
SET @atdString = 'BF Goodrich'; -- the brand name as it exists in ATD | |
SET @ariString = 'BFGoodrich®'; -- the brand name as it exists in ARI | |
SELECT 1 | |
WHERE | |
( | |
REPLACE(LOWER(@atdString), ' ', '') = REPLACE(LOWER(@ariString), ' ', '') OR | |
REPLACE(LOWER(@ariString), ' ', '') LIKE CONCAT(REPLACE(LOWER(@atdString), ' ', ''),'®') |
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
DECLARE @brands TABLE (brand NVARCHAR(50)); | |
INSERT INTO @brands (brand) | |
VALUES ('BF Goodrich'); | |
SELECT * | |
FROM dbo.productOwners | |
INNER JOIN @brands ON | |
REPLACE(LOWER(brand), ' ', '') = REPLACE(LOWER(productOwner_name), ' ', '') OR | |
REPLACE(LOWER(productOwner_name), ' ', '') = CONCAT(REPLACE(LOWER(brand), ' ', ''),'®') |
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
DECLARE @time DATETIME = DATEFROMPARTS(2014, 11, 15); | |
-- Using 998 for milliseconds portion because using 999 winds up being the same as 000 of the next second, for some weird reason. | |
-- This winds up being 2014-11-15 23:59:59.997, even though we've specified 998. | |
SELECT DATETIMEFROMPARTS(DATEPART(year, @endTime), DATEPART(month, @endTime), DATEPART(day, @endTime), 23, 59, 59, 998); |
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? | |
IF EXISTS (SELECT * FROM sysobjects WHERE id = object_id(N'[dbo].[mySproc]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1) | |
BEGIN | |
DROP PROCEDURE dbo.mySproc; | |
END; | |
GO | |
-- OR JUST THIS? |
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
using System; | |
using System.Linq; | |
using System.Data; | |
using System.Data.SqlClient; | |
using System.Threading.Tasks; | |
using Dapper; | |
public class Program | |
{ | |
public static void Main() |
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
logoImageUrl = | |
!String.IsNullOrEmpty(logoImageUrl) ? | |
logoImageUrl : null; |
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
private static IEnumerable<KeyValuePair<TKey,TValue>> RemoveByKey<TKey,TValue>( | |
this IEnumerable<KeyValuePair<TKey,TValue>> pairs, | |
string key) | |
{ | |
var index = pairs.Select(x => x.Key).ToList().FindIndex(x => x.Equals(key)); | |
if (index >= 0) | |
{ | |
var result = pairs.ToList(); | |
result.RemoveAt(index); |
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
using System; | |
using MvvmHelpers; | |
using PropertyChanged; | |
using Xamarin.Forms; | |
namespace Blah | |
{ | |
// The rest of this page is of course defined in XAML | |
public partial class MyPage : ContentPage | |
{ |
OlderNewer